Getting downvotes and I missed the edit window.
Google's profit margin is 26.7%[1] which includes all the money the spend on non-revenue generating engineering like Chrome, ChromeOS, etc etc.
Apple's profit margin is 23.95%[2], and they have very few non-revenue generating activities.
Apple has that pesky hardware business eating at the margins. They are a very, very efficient manufacturer, but hardware margins are always less than software (especially search, which might be the most profitable business ever in terms of margin).
(Also, don't forget Google makes a huge amount off mobile search on iOS devices).