It's a numbers game.
Apple will sell about 75 million iPhones this year. They have an average price just shy of $700 and have a gross margin of about 45%.
Macs, on the other hand, will sell between 5 and 6 million units. They have an average price of about $1250 and a gross margin of only 25%.
As a shareholder, it's pretty obvious where they should focus their attention. They can sell more phones at a higher gross margin and also generate additional revenue from the myriad of services tied to these devices.
Still both device are complementary, they do not compete.
Also they benefit each other as they create the apple lifestyle and help promote the brand. When you go to a uni lecture and you see half the laptops have the apple glowing logo it really has an advertisement effect.
Kraft does not abandon its peanut butter line since it makes more money from noodles.