Codeshare routes are routes that you share will other members in your alliance.
If you are codesharing with someone, the person who owns the route gets majority of the profit, but the person who is codeshares will get some profit as well.
Codesharing can help fill up planes, especially in competition routes and any kind of route that has less than 55% capacity as codeshare routes get more passengers.