The second-quarter earnings season has kicked off, and snack food and beverage giant PepsiCo (PEP 3.62%) was one of the first companies to release its results. Earnings and revenue both came in above analyst expectations for the period, driving the stock higher during trading hours on July 12.

Shares of Pepsi are now flat year to date, faring much better than the S&P 500's 20% drop, which shows how well the company is able to combat inflationary pressures that have run rampant around the globe.

Here's why PepsiCo's business is performing strongly right now and why the snack food and drink categories are so resilient in the face of high inflation. 

Strong second-quarter results

On July 12, Pepsi released its quarterly results for the three months ending June 11. Organic revenue grew 13% year over year in the period, driven by 11% growth in North America and 15% growth internationally. Earnings per share (EPS) came in at $1.86, up 10% from 2021, and the company has generated $1.88 billion in operating cash flow over the past 12 months.

Pepsi is such a large and profitable business because it owns some of the most popular snack and beverage brands worldwide. This includes Pepsi, Gatorade, Lay's, Tostitos, Rockstar Energy, and many others.

Most important for growth are Frito-Lay and Pepsi. In the second quarter, Frito-Lay had 14% organic revenue growth and gained market share in savory snacks around the world, while Pepsi's revenue in North America grew 9% organically. These are brands people have chosen for years in many countries around the globe.

Inflation has affected Pepsi's profitability slightly, with gross margin decreasing 45 basis points in the quarter. But this is only a small impact that can be mitigated by raising prices and continued operating leverage. Investors should expect management to keep raising prices if inflation remains high in the coming quarters.

Pricing power in snacks and soft drinks

But how much can Pepsi raise prices on its snacks and beverages? Won't people eventually just stop buying them? Logically you'd think so, but historically strong brands in consumer packaged goods like the ones Pepsi owns can raise prices pretty substantially without seeing any drop-off in consumer spending.

Why? Because these items are generally not that expensive. If a pack of Pepsi costs $6 a year from now instead of the $5 it cost two years ago, that is not a huge difference in a person's grocery or convenience-store receipt. This is also true for items like chips, sports drinks, or energy drinks, which are all categories in which Pepsi has a large market share. Compare this to when a tank of gas goes from $40 to $100 because of rising oil prices, or when buying meat for a family meal goes from $20 to $30 in less than a year.

We also shouldn't forget the brand value that Pepsi and Lay's have compared to other items like gasoline. These snacks and beverages have distinct and consistent tastes that are a part of people's everyday habits. It is not likely that people are going to switch to another brand (that is also raising prices) because they now have to spend a few more dollars a week on chips and soda.

The stock is not cheap

Even though Pepsi's business is uber-resilient during inflationary periods, the stock is not cheap. With shares treading water this year, the stock trades at a market cap of $235 billion. With $10.8 billion in operating income and $7.5 billion in free cash flow over the last 12 months, the stock has a price-to-operating-income multiple of 22 and price-to-free-cash-flow of 34. This isn't cheap for a company with slow top-line growth like Pepsi. 

PEP Operating Income (TTM) Chart

PEP operating income (TTM). Data by YCharts. TTM = trailing 12 months.

There's no reason to sell your shares of PepsiCo anytime soon, as this is a wonderful business. But given where the stock trades right now, it might be smart to look elsewhere for new additions to your portfolio.