It’s important to note that these figures didn’t come from Google directly. It looks like Oracle calculated the profits based on documents provided by Google. Because Oracle wants compensation from Google, it benefits from a higher estimate, so take it with a grain of salt.

On the other side, Google is in a tricky situation: publicly admitting it makes a lot of money from Android bolsters Oracle’s financial claims, while denying it could spook investors worried that Android is a money sink. That’s why Google has always been tightlipped about Android financial data.

Android is, of course, free to use by any OEM. So how is Google able to make billions in profits from it?

We can only guess, but two sources stand out: mobile advertising and app sales.

Mobile advertising

Mobile advertising is clearly the main source of revenue when it comes to Android. We know – also thanks to Oracle’s lawyers – that Google paid Apple $1 billion to be the default search engine on iPhones and iPads in 2014. That’s just the tax that Google had to pay for the privilege, so the actual iOS revenue is likely a few times larger.

iOS users are more lucrative compared to Android users from an advertising perspective, because, on average, they have larger incomes and they are more likely to buy stuff online. But Android users are much more numerous than iOS users. In September 2015, Google said there were 1.4 billion Android devices in use worldwide. Even with a lower average revenue per user, the money that Google makes from ads shown on Android devices is probably significantly larger than the iOS revenue. And, there is no Apple tax to pay.

Google makes money from the ads that are displayed when users search via its app and online. Many people also use YouTube, Google Maps, Drive, Gmail, and Google’s many other apps and services. Google shows ads in some of these services, but it also analyzes user data to improve the relevancy of the ads it serves in other places. And, because every phone user has to sign in with their unique account when setting up a phone, the data is accurate and highly personal.

Google also makes a few cents whenever you click one of those ads shown in many ad-supported apps.

Now mobile advertising makes Google less money than computer searches, because the value of a “click” is generally smaller. But mobile usage increases every year, and thanks to Android and its suite of apps, Google has a network of capillaries extracting money out of the entire ecosystem.

Apps

Apps are the second big source of money for Google. The company takes a cut from every sale app developers make on the Play Store. And it’s a big store, with over 1.5 million apps, out of which a big chunk are paid apps or apps that offer in-app purchases. Google takes a 30% cut out of every sale, offering in exchange the platform and some of the required infrastructure, including a cloud system for delivering notifications.

Play Store media

Google also makes some money from the media side of the Play Store. Paid music, movies, books, and subscriptions are just a tap away for hundreds of millions of users, so even with a low usage rate, it’s fair to assume that there’s a steady trickle of money coming in from this source.

Everything else

Mobile advertising and app sales are the biggest sources of Android revenue for Google. The company sells some hardware, but with the small profit margins that hardware allows, that money is largely insignificant. The same can be said about ventures like Android Pay and Project Fi.

Google does not make money from Android in itself. Anyone can take the Android source code and use it on any device. Likewise, Google doesn’t make money from licensing its suite of mobile Android apps. Apps like Google and YouTube are free, even though manufacturers reportedly have to pay third-party testing companies six-figure sums to ensure that their devices meet Google’s compatibility requirements.

Since then, the number of Android devices nearly tripled and the number of iOS devices ballooned as well. Plus, in 2016, Android has far more mobile apps and Play Store content. All this considered, the $31 billion lifetime estimate doesn’t look too farfetched. For what is worth, Google did not dispute this figure, it just wanted it to be made confidential. It’s even possible that the sum is actually smaller than reality, depending on how Oracle defines revenues.

At the very least, it’s clear that critics that derided Google for not making any money from Android were terribly wrong.