If you're one of the nearly 2 billion people that log into Facebook (META -0.93%) every month, you probably know, at least on some level, how the social network makes money. In between status updates, photos of friends and their puppies, and the latest viral videos, you'll see ads for all sorts of things. Right now, I'm seeing ads for credit cards, The Motley Fool (I visit this site a lot), and something called Wikibuy. Facebook is remarkably good at figuring out what people are interested in.

Facebook brought in nearly $27 billion in ad revenue in 2016. All told, 97% of Facebook's revenue comes from selling ads across Facebook and Instagram. What's more, that percentage ought to climb even higher as Facebook grows its ad business and its payments business (the other 3%) continues to decline.

Diving deeper into where all of Facebook's money comes from can help investors figure out how likely those sources of revenue are to increase, and what kind of impact they'll have on the company as a whole.

Facebook's "like" icon on the sign leading to its Menlo Park campus.

Image source: Facebook

The growth of mobile advertising on Facebook

Since Facebook introduced mobile advertising in 2012, it has been a huge revenue growth driver for the company. Last year, mobile advertising accounted for 83% of total advertising revenue. That's up from just 11% in 2012.

From 2012 to 2015, Facebook's desktop ad revenue remained relatively flat, while mobile advertising exploded. Facebook made some changes to its desktop ads in 2014 that improved the quality of the ads but reduced total ad impressions. The focus on improving the ads seems to have worked out, however, as desktop ad revenue returned to meaningful growth in 2016. Still, the growth isn't nearly as spectacular as mobile advertising.


Data source: Facebook annual reports.

There are several factors behind mobile's stark outperformance. First of all, mobile daily users more than tripled since the end of 2012. The number of mobile-only users has more than doubled in the last two years alone. Perhaps more importantly, users are simply able to spend more time on Facebook with their mobile devices as they're always available -- in the checkout line, during television commercials, or before getting out of bed in the morning. Additionally, Instagram is almost exclusively accessed via mobile devices.

Facebook's ability to dominate mobile bodes well for its future growth. Mobile advertising was a $109 billion market last year, according to eMarketer. The research group expects mobile ad spend to climb to $247 billion by 2020, a 23% annual growth rate.

Facebook's flagship app still accounts for most of its revenue

While Facebook doesn't break out revenue from any of its individual apps, management has made it clear that revenue from its other apps still don't produce a whole lot. "The biggest driver of our business is core Facebook, just in terms of sheer size and even sheer contribution to growth," CFO Dave Wehner told analysts on Facebook's fourth-quarter earnings call. "Instagram is growing quicker on a percentage basis but it's much smaller," he added.

Indeed, Facebook has done a phenomenal job growing the amount of revenue from its core app. But growth may slow down later this year: Wehner warned investors the company is facing ad load saturation in its flagship app. That is, it can't squeeze any more ads in without negatively impacting their efficacy.

As such, Instagram (and other apps like Messenger and WhatsApp) may start accounting for more of Facebook's revenue growth going forward. It also means Facebook's overall growth may slow if other factors like engagement, user growth, and average ad prices don't increase to offset the lack of growth in ad space.

To be sure, it's not something Facebook investors have to worry about too much, as Facebook has plenty of growth drivers. It's also constantly experimenting with new ad formats, which may open up additional inventory or help increase average ad prices on its flagship platform. In the meantime, Instagram is growing like crazy.

So, Facebook's revenue comes mostly from mobile ads, and specifically the Facebook app. That's both a good and bad thing, as mobile advertising is expected to grow rapidly through the end of the decade, but Facebook is having trouble finding new places to squeeze in ads. Overall, though, that's a good problem to have.