For example when UA
sells flights on LH
leases a set amount of seats on the aircraft to sell as they wish including setting prices and inventory yield management. That's why the code share operating airline could be much less expensive for the same flights or vice versa. Depending on the agreement the airlines have with each other the code share carrier can release seats back to the operating carrier or vice versa. For international code shares the airlines are also subject to international agreements etc.
For a "partner airlines" such as an HP
express operated by Mesa HP
pays a fixed fee per flight based on the aircraft and negotiated contract. This just about guarantees a profit for Mesa unless fuel prices spike etc. That's why so many of the regional airlines are perpetually in the black. The only problem is that the mainline pilots union contract limits the size (usually less than 100 or 70 seats) or number of flights allowed to be flown by the regional. That is to protect the pilots since the regional carrier had lower labor costs.
[Edited 2004-12-17 18:22:43]