Investors are worried about a recession on the way, and that's normally a time when Wall Street flocks toward sturdy dividend payers like Procter & Gamble (PG -0.03%). The consumer staples giant has endured many downturns over the decades thanks to its dominant market position and its huge portfolio of essential brands and products.

But P&G stock is struggling to keep pace with the market, down about the same 22% as the S&P 500 through mid-October. It is even trailing its smaller rival Kimberly-Clark (KMB -0.98%). Let's look at why investors are feeling cautious about Procter & Gamble stock, and whether that price slump represents a good opportunity to buy.

The latest trends

P&G gave investors a mixed reading on its business in its last earnings report. Sure, organic sales expanded by 7% in the fiscal fourth quarter, matching the healthy growth rate for the wider fiscal year that closed in late June. But look behind that headline growth figure and you'll see some areas of concern.

Sales volumes were down in three of P&G's five core segments and were flat in the other two. The company achieved all of its organic growth, then, through raising prices. While that fact reflects P&G's pricing power, the company would prefer to expand sales through a balance of rising prices and improving sales volumes. Weaker volumes imply that customers are reducing their spending and shifting toward more value-based brands.

Profitability is also shrinking despite those price hikes. P&G boosted earnings by just 3% over the last 12 months, or less than half the rate of its sales increase. That's still better than Kimberly-Clark, which reported declining core profits in the most recent quarter.

A weak short-term outlook

Both companies are projecting that things will get worse before they get better. "We expect another year of significant headwinds," P&G's CEO Jon Moeller said back in late July. Management projected that organic sales growth will slow to between 3% and 5% for the year, mainly driven by price increases. Earnings will be sluggish, too, up about 2%.

Investors are worried that these projections might have to be lowered when P&G reports its fiscal first-quarter operating results on Oct. 19. While supply chain challenges have eased, inflation was stubbornly high in recent months, and economic growth has slowed in key markets like the U.S. and China.

Is it a deal?

The prospect of a weak sales and earnings year ahead helps explain why P&G's stock has declined. But there are good reasons to be bullish about the long term. The company is likely to gain market share while generating healthy earnings and cash flow.

It will return over $15 billion to shareholders through stock buybacks and dividend payments, too. That dividend, which currently yields nearly 3%, has been growing steadily for over 60 years, in fact, and is highly likely to continue expanding through any recession that might develop.

As a result, investors might want to take a closer look at P&G's stock. In exchange for a volatile few quarters ahead, you can own this stellar business at a big discount to the valuation that Wall Street was paying just a few months ago. Capitalizing on general market pessimism tends to be a good strategy to bolster long-term returns, especially with stable, world-class businesses like Procter & Gamble.