Procter & Gamble (PG 0.29%) might be the ideal stock for today's environment. Its business has thrived through prior recessions with pricing power providing flexibility in the battle against inflation. As a holding, P&G can anchor a portfolio with its balance of sales growth and direct cash returns. The Dividend King has expanded its payout in each of the last 66 years, after all.

Let's take a look at those factors that have kept the stock beating the market so far in 2022.

Market share gains

A sure sign of a strong business is that it can win market share through a wide range of selling environments. That's clearly the case for Procter & Gamble. Sales in the most recent full fiscal year were up 7%, easily beating rivals such as Kimberly-Clark.

P&G entered the pandemic with faster sales gains than its peers thanks to dominant brands across niches like clothing care and home cleaning. That competitive advantage only grew stronger over the last few years and is helping the company maintain momentum even as shopping habits shift.

P&G isn't immune to economic slumps, though. Its growth in the last quarter came entirely from rising prices, for example, as volume slipped by 1%. In better economic times, investors are used to seeing the company grow with a balance of rising prices and increased volumes.

Stellar finances

One line in P&G's latest earnings update seems dry at first blush but captures a huge reason why investors love this stock. Profitability "increased 20 basis points on a currency-neutral basis," management said. In other words, P&G is expanding its bottom-line margin despite historic spikes in raw material and transportation costs.

That success is a strong signal that it has both pricing power and an efficient business. So is the fact that the operating margin is a full 10 percentage points higher than Kimberly-Clark's comparable metric.

PG Operating Margin (TTM) Chart

PG Operating Margin (TTM) data by YCharts

The efficiency also shines through in P&G's cash metrics. It converted 93% of its earnings in the past year into free cash flow. Success here allowed it to spend freely in areas like marketing and research and development, but also to direct investor returns. P&G allocated $19 billion to shareholders last year, split about evenly between stock buybacks and dividend payments.

Keep it in the portfolio

The shares are beating the market in 2022, but not by much. Investors are worried that P&G might be in for a painful period of falling volume as economic growth declines. But the company's long history demonstrates that it can survive through a wide range of selling conditions.

It is likely that P&G will emerge from this latest slowdown with even stronger competitive assets and plenty of cash. In the meantime, shareholders can collect a dividend that today yields nearly 3%.

That's a solid bonus for holding an already impressive business. Automatic dividend reinvestments, meanwhile, will help patient investors collect more of P&G's stock if prices go sideways or fall a bit lower over the next few quarters, as most of Wall Street seems to expect.