Following the big sell-off after its 2012 IPO, Facebook (META -4.13%) has rebounded to become one of the best-performing large-cap tech stocks. 

FB Chart

FB data by YCharts

And the shares' continued outperformance has been propelled by an equally robust financial performance from the social-media leader.

But where does that profit come from? Turns out the online media giant relies on one of the most well-worn business models around: advertising.

Inside Facebook's advertising empire

Much like its larger tech counterpart, Alphabet, Facebook funds its operations almost exclusively through ads. In its most recent fiscal year, 95% of Facebook's revenues came from advertisements, and the company has become increasingly reliant on ads in recent years.

Here's how Facebook's sales, profits, and overall reliance on ads have shifted:

Metric

2015

2014

2013

Revenue

 $17,928

 $12,466

 $7,872

Net income

 $3,688

 $2,940

 $1,500

Advertising revenue as a percentage of total sales

95%

92%

89%

Data source: Facebook Investor Relations. 

Facebook is about as direct an advertising play as it gets these days. The good news is that -- thanks to all the user data Facebook has on all of us --its ads are tremendously profitable in comparison with alternatives such as display ads. And it appears likely to continue its impressive momentum in the years to come.

The future is bright for Facebook

Facebook and Alphabet enjoy leading roles in the long-term secular growth story that is the online advertising market. Market researcher eMarketer predicts that online advertising in the U.S. alone will increase from $59 billion last year to over $105 billion by 2020, and eMarketer's data doesn't even capture the additional multibillion-dollar opportunity in online video, which it estimates will garner a further $16 billion in ad spending in 2020.

Today, Alphabet leads this space, controlling a slight majority of all online ad spending in the United States. However, as the ascending No. 2 player in this booming market, Facebook has a favorable outlook for the coming years.

Image source: Facebook.

To get more specific, Bank of America's investment research division currently estimates that Facebook's sales will rise 53% in 2016, 24.5% in 2017, and 27.7% in 2018. B of A's model also calls for Facebook's profit to rise at a similarly spectacular rate over this period. All told, B of A expects Facebook's sales and profit to total $47.2 billion and $20.4 billion in two years' time. That outlook isn't the sole factor influencing Facebook's stock price, but it does suggest that Facebook will be able to maintain the upward trajectory in its shares.

If there is a looming impediment for sustained stock price gains in the near term, it's Facebook's own elevated valuation. After its 44% gain in the past year, Facebook stock trades at a price-to-earnings ratio of nearly 60. Yes, such an elevated trading multiple may be justified, given Facebook's outsized growth potential, but the reality is that it's probably as close to "fairly" valued as you can get in a long-term growth stock like Facebook, Alphabet, and Amazon.com.

Either way, investors would do well to note that Facebook's ad-based business model is likely to be a long-term tailwind for the company.