Wall Street woke up on the wrong side of the bed on Monday, and major market benchmarks suffered as a result. The S&P 500 (^GSPC 0.87%) fell back from its all-time high on Friday, and losses for the Dow Jones Industrial Average (^DJI 0.67%) and Nasdaq Composite (^IXIC 1.11%) showed the breadth of discomfort among stock investors to start out the week.

Index

Daily Percentage Change

Daily Point Change

Dow

(0.89%)

(320)

S&P 500

(0.91%)

(43)

Nasdaq

(1.39%)

(217)

Data source: Yahoo! Finance.

Yet even as the overall market suffered declines, some companies that many investors consider to be safer names  held up reasonably well. In particular, both Procter & Gamble (PG 1.52%) and PepsiCo (PEP 1.34%) hit all-time highs on Monday, and the success of their respective businesses could point to further gains ahead for their stock prices.

P&G is A-OK

Shares of Procter & Gamble were up another 1.5% on Monday. That brought the stock's year-to-date gains to about 13%, and even though that's lagging the overall market, P&G has regularly been hitting all-time highs since this past summer.

A couple of trends have helped Procter & Gamble tremendously over the past few years. The COVID-19 pandemic raised demand for the staple products that P&G produces, especially must-have items like toilet tissue, home cleaning products, and personal care items. Top brands like Charmin, Mr. Clean, and Gillette command sizable market share both in the U.S. and in areas around the world.

More recently, as inflation has risen dramatically, companies that have pricing power have a competitive advantage over those that don't. Procter & Gamble has developed a loyal customer base that's better able to absorb price increases, and that has allowed the company to pass through higher costs for raw materials more effectively than rival consumer goods providers.

Procter & Gamble has generated considerable free cash flow, much of which it shares with investors through dividends. The stock currently yields 2.2%. While not immune from cost pressures, P&G has done a good job keeping expenses under control, and it's no surprise to see nervous investors bidding the stock to record levels.

Two people drinking from glasses holding a dark liquid.

Image source: Getty Images.

Some fizz in PepsiCo's stock

Elsewhere, shares of PepsiCo were up about half a percent on Monday. The snack and soft-drink giant's stock has been in a long bull market throughout much of the 2010s, routinely reaching record levels along the way.

PepsiCo has been firing on all cylinders lately, with consumers dramatically boosting their demand for its products. In the third quarter, PepsiCo produced organic revenue growth of 9%, with international markets seeing substantially higher sales volumes. Even with higher costs, operating cash flow was up considerably from 2020 levels, and PepsiCo was able to boost its forecast for full-year sales and earnings growth.

Dividend investors love how PepsiCo treats them. The stock currently has a 2.5% dividend yield, and the snack and beverage company has boosted its annual dividend payout every year for nearly a half-century now.

Investors shouldn't expect PepsiCo and Procter & Gamble to generate the sort of short-term explosive gains that higher-growth stocks sometimes generate. Yet in these turbulent times, the benefits of safer stocks like these become much more evident -- and it's easy to see why the two stocks are at record levels as a consequence.