Check this out: In searching fares on the United and South African Airways websites; same route, same aircraft (an SAA flight on the ass-flatening IAD-DKK-JNB route), the SAA return price is around $1,100 (cattle class) whereas United wants closer to $1,500.

What gives?

Maggs swings, it's a drive deep to left! The Tigers are going to the World Series!!!

Presumably, if it is a codeshare flight, the reservations systems are treating it as two separate flights. A certain number of seats are blocked for UA customers. Given that each airline will use its own yield management strategies to sell its own block of tickets, I can only assume that UA has sold more of its tickets than SAA has on the same plane...
I've noticed this before with for example the DL flight LHR-JFK - tickets can be cheaper if bought from KL as a KL codeshare operated by DL.