Difference between SMPEND and SMPMID
As with all these kinds of low level issues, you have to read the datasheet.  It's OK to call library routines, but on these small resource-limited systems where you're always close to the hardware, you have to know what's going on at the low level whether that is done in a library routine or your own code.

Read the SPI part of the chapter for the MSSP peripheral.  That goes into some detail about these modes, and includes timing diagrams for the various combinations.  I could copy some of that here, but that would be pointless as you need to read the datasheet anway.

This is a good example where just writing the code yourself would have actually been easier than calling a library routine.  That is not because the call is hard, but to verify that someone else's library does exactly what you need takes longer than just setting up the hardware that way in the first place.  There are only 2 8-bit registers to set up to use the MSSP, which should results in 4 instructions.