Source: Apple.

Thanks to an ongoing lawsuit between Oracle and Google -- the Alphabet (GOOG -1.22%) (GOOGL -0.95%) subsidiary -- we've been treated to some interesting details of Google's Android business. Earlier this month, Oracle revealed documents indicating that Google has generated $31 billion in revenue from Android through ads and its Google Play store, resulting in $22 billion in profit over its lifetime.

But that's nothing compared with the giant piles of cash Apple (AAPL -0.60%) has stacked up since releasing the iPhone. Last quarter alone, Apple sold 74.8 million iPhones, generating $51.6 billion in revenue.

It's easy to see why the iPhone produces so much more profit than Android -- the iPhone is one of the most popular computing devices nowadays, after all -- but let's look at a few more details.

iPhone history
Since its release in 2007, the iPhone has sold 896.5 million units. Over the past eight and a half years, it's brought in $570.8 billion in revenue for the company. Even at a conservative 25% net profit margin for the device, that's $142.7 billion in profit.

Here's what that looks like compared with Google's revenue and profit from Android.

Source: Compiled by author using reports from Apple and Oracle via Bloomberg.

Of course, this isn't exactly an Apples-to-apples comparison, so to speak. Those numbers don't include the revenue Apple generated from the App Store, iTunes, or iAd thanks to the iPhone. Additionally, Android revenue and profits include tablets and other devices. On the other hand, it only looks at Google's share of the Android ecosystem and doesn't include profits from device sales.

But even while Apple has sold a small minority of all smartphones over the past eight years, it's managed to take a majority of the industry's profits. In the third quarter of 2015, Canaccord Genuity estimated that Apple took a staggering 94% of all smartphone operating profits.  

Its next closest competitor, Samsung (NASDAQOTH: SSNLF) fell to just 10% of profit share, while some manufacturers posted negative operating profits. Samsung has had trouble selling its high-end devices, and the average selling price of its smartphones that quarter was just $180. Meanwhile, Apple is experiencing increasing ASPs, with the iPhone reaching $690.50 last quarter, up from $670 the quarter before.

Even factoring in the profits from Google's hardware partners, the iPhone is much more profitable than Android.

Hidden profits
Oracle's report only details the direct benefits Google receives from Android -- app sales and advertisements. What it doesn't consider, however, are the indirect benefits Google sees from Android.

Android made it possible for phone manufacturers to proliferate inexpensive smartphones, which caused an explosion in the number of people with access to the Internet. What's more, smartphones are on us all the time, which means we use the Internet more than we did before. As a result, the number of search queries on Google, and the ad impressions from Google's network partners, grew significantly over the past eight years, much to Google's benefit.

Last year, Google announced that it now sees more search queries on smartphones than on desktops and laptops. Although mobile search and display ads typically carry lower prices than their desktop counterparts, it's a revenue stream that hardly existed for the company last decade.

It should be no surprise, then, that Alphabet's market cap is just 8% lower than Apple's. While the iPhone has been tremendously profitable for Apple, it's now facing slowing (even negative) growth after years of hypergrowth. Analysts expect Alphabet's sales growth to slow down at some point in the future as well, but it's still expected to post numbers well above Apple's low-single-digit revenue growth for next couple of years.

That doesn't make Apple a bad ... apple. On the contrary, iPhone sales throw off tons of cash and will continue to do so for the foreseeable future. With the cash cow, Apple can reinvest in R&D while continuing to raise its dividend and share buybacks.