It's one of the biggest consumer food companies around, and yet PepsiCo (PEP 0.74%) is often misunderstood on Wall Street. Take the fact that the company recently raised its sales and earnings outlook for the second time in 2023 thanks to strong demand across its portfolio of snacks and beverages. Despite that positive operating picture, shares are underperforming the S&P 500 by a wide margin.

Smart investors can look at that performance gap as an opportunity to buy a valuable business at a discount. With that idea in mind, let's look at a few factors that make PepsiCo stand out as an attractive option for your portfolio.

1. The diversity is the point

Pepsi's growth is a bit more robust than rival Coca-Cola's right now. This past quarter, organic sales were up a blazing 13% compared to Coke's 12% boost. Sure, Coke got its gains through a healthier mix of rising sales volumes and increased prices, while Pepsi had to rely solely on price hikes. But Pepsi is still winning market share across several key niches, from snacks to breakfast foods to sodas to sports drinks.

That diversity is valuable for investors looking for stability, too. While owning Coke exposes you to the on-the-go beverage industry, Pepsi shareholders benefit from rising demand for sweet and salty snacks as well. It's almost like owning some of Coca-Cola and McCormick, the spice, flavorings, and condiment specialist, all in one investment.

2. The cost trend is your friend

Like its peers, Pepsi has been dealing with an unprecedented cost spike over the last year or so as expenses rise on labor, transportation, and materials like aluminum. This boost has pressured profitability, with operating profit margin falling to about 13% of sales from 15% during the pandemic.

PEP Operating Margin (TTM) Chart

PEP Operating Margin (TTM) data by YCharts

That picture should be changing soon, though. Price increases are already lifting earnings, as core profits are up 16% over the first half of 2023. Inflation is slowing down in areas like freight and raw materials as well. Combined with robust demand, these factors should all translate into higher profit margins over the next several quarters.

3. Shares are priced to move

Despite all of these positives, Pepsi's stock is still priced as if the business is struggling. You can buy shares for less than 3 times annual sales today. Coca-Cola is priced at double that valuation. McCormick shares cost 3.6 times revenue right now.

Toss in the company's dividend, and the return picture looks even brighter. Pepsi has been paying, and boosting, its dividend for decades, and the current yield is sitting at 2.7%, or roughly 1 percentage point higher than McCormick's yield.

Investors shouldn't purchase the stock simply for that income, but it does amount to a nice bonus. Pepsi's shares have a good chance at delivering market-beating capital appreciation as the business grows sales and earnings over the next several years.

Combined with dividend income and stock buyback spending, that's a prescription for excellent returns. Don't let short-term pessimism around the company's lower margin and declining sales volumes keep you away from this attractive growth stock.