Originally Posted by
soorox
...and airlines do code-share out of alliances which doesn't really make sense.

Why not?! I am sure it makes business and financial sense for them, otherwise they would not do it. Being part of an alliance is one way for a particular airline to maximise its revenues/profit but by no means should it be the only one.