Meta Platforms (META -0.22%), the parent company of Facebook, Instagram, and WhatsApp, has taken plenty of heat in recent years over what some consider rampant spending. And rightly so.

One prime example of this was the company's rebranding to Meta, to signal its long-term goal of building a metaverse business. Another example was the expansion of a business segment known as Reality Labs, which includes the Quest VR headsets and related software sales. Reality Labs lost $4 billion in the first quarter alone.

It hasn't been all bad at Meta, though. In fact, even as the company invests heavily in the metaverse, it remained highly profitable and still manages to return lots of excess cash to shareholders via share repurchases. In fact, it doled out quite a bit of buying back in 2022 during the current bear market, which is starting to look like really good timing considering the first-quarter earnings report. 

Timely stock buybacks during a nasty downturn

Stock buybacks are a way that many companies -- especially tech companies -- return cash to their shareholders. Instead of issuing a quarterly dividend, a company can choose to buy stock on the open market and retire it. If this lowers the overall share count, it means more net income and free cash flow per share is available for the remaining shares. 

One metaphor to explain it would involve a pizza pie representing earnings. With buybacks, your slice of pizza gets bigger as a percentage of the overall pie. The only problem was that in 2022, the pizza overall was getting smaller, even as shareholders' percentage of that pie grew. Net income at Meta fell 41% in 2022 to $23 billion. Nevertheless, while the company was still profitable, CEO Mark Zuckerberg and the company chose to keep repurchasing stock (which cost $28 billion) and reduced the total share count by 5%.

But here's the real kicker: Those shares were repurchased at discounted prices, especially in comparison to Meta stock now (it skyrocketed some 170% since its multiyear low in November 2022).

META Chart

Data by YCharts.

The stock buybacks in 2022 were prescient. Basically, management bought low, executing an excellent use of free cash during the worst of the bear market.

The pace of repurchases ticked up again in the first quarter, totaling $9.22 billion. Meta had $41.7 billion remaining in its current share repurchase program at the end of the quarter, worth 6.7% of the current market cap (if you're looking for a dividend-yield equivalent to that repurchase program).

The metaverse losses get all sorts of media attention, but Meta is actually being more prudent than it gets credit for right now and is trying to do right by its investors.

But what about the 2021 stock repurchase program?

Of course, those were just the 2022 and first-quarter 2023 stock repurchases. Meta has actually been buying back stock for years. And in 2021, it wasn't so judicious with its cash deployment. It repurchased $44.5 billion in stock in 2021, while the stock was trading at all-time highs (before the bear market of 2022 struck).

Sure, Meta still reduced its overall share count that year, effectively increasing the size of the pie for remaining shareholders. But in an ideal situation, it's better for a company to deploy more cash to buy back stock when the share price is low, and less cash when the share price is high. 

META Chart

Data by YCharts.

Viewed through this lens, the company grossly overpaid and blew through a lot of cash for share repurchases in 2021. 

Will the "year of efficiency" pay off?

The company is forecasting a return to robust growth in the second quarter, with revenue projected to be in a range of $29.5 billion to $32 billion -- compared to $28.8 billion in the 2022 second quarter, and $29.1 billion in the same quarter in 2021.

If Zuckerberg's proclaimed "year of efficiency" pays off and profit margins rebound along the way, the stock could regain all-time highs, and help justify those share repurchases in 2021.

Meta stock trades for just shy of 22 times expected 2023 earnings as of this writing. I wouldn't recommend buying this hot stock just because the share price is racing higher. But if you already have Meta in your portfolio, it's probably worth holding on to right now -- especially as the company looks committed to doling out plenty more cash via repurchases in the years ahead.