Purchasing a code share flight on one ticket (through your primary airline) doesn't necessarily guarantee a lower fare. The protection you are getting is that both flights will be on one ticket and that means if your first flight is delayed and you miss your connecting (code share) flight it is the airline's responsibility to get you to your final destination. If you travel on two separate tickets and you miss your connecting flight it becomes your responsibility to get to your final destination. Depending on the airline this could mean having to purchase another ticket at "full fare". This can be especially costly if you miss your connection on your flight back to your home airport.

L