The consumer staples industry is an attractive one for many investors seeking a balance between stability and earnings power. Companies that excel in this space tend to reward shareholders with strong returns through a wide range of selling environments, even if earnings growth is often eclipsed by other sectors when the economy is booming.

Costco (COST 1.01%) and PepsiCo (PEP -0.62%) are respective leaders in their consumer staples niches. And while they don't compete against each other, the two businesses share similarities that make them appealing as investments. So, let's compare the two to see which could be the better buy right now.

Costco for growth

Costco and Pepsi both deliver a measure of diversity that's hard to find in their market segments. Costco sells a high proportion of services and consumer discretionary products in addition to its core groceries division. For PepsiCo, its snack and food segment gives it a huge growth target beyond just sparkling beverages.

There's little separating the two companies when it comes to their reported growth rates. In early February, Costco revealed that comparable-store sales were up 5% in the past few months. Pepsi announced at around the same time that it is expecting organic sales to rise by "at least 4%" in the 2024 fiscal year.

Yet Costco still has the edge in this key metric. The chain posted a healthy 4% customer traffic boost in the most recent quarter, and sales growth accelerated into early 2024. Pepsi, on the other hand, is seeing declining sales volumes. Management warned investors that revenue trends are slowing down due to a combination of reduced inflation and weaker demand. Costco's momentum is much more positive as a result.

Pepsi for profits

Investors who prioritize earnings power will find more to like about Pepsi stock today. Sure, the company isn't nearly as profitable as its key rival, Coca-Cola. But Pepsi still converts a respectable 13% of sales into operating profit compared to Costco's 3% rate. Pepsi is boosting that figure, too, with help from cost savings and this past year's price increases. Conversely, Costco's margin tends to hold steady at that 3% level whether its sales are booming or not.

The beverage giant also delivers more predictably rising cash returns to shareholders. After spending $8 billion in each of the past two years on dividends and stock buybacks, management hiked the dividend in February by 7%, equating to a nearly 3% yield. Costco commits to a much smaller payout (yielding 0.6% right now) and isn't nearly as aggressive, or predictable, with its dividend raises. Count this as a win in Pepsi's column.

Price and value

The strongest business won't be the right investment if the price is too high. That's a bigger risk with Costco than with Pepsi at the moment. You'll pay 1.3 times sales for this stock right now, which is near a 10-year high. Costco is also very expensive compared to peers like Target and Walmart. Pepsi, meanwhile, is priced at a discount to Coca-Cola and its price-to-sales ratio of 2.5 is right within the range that investors have seen in the past few years.

Investors must balance that discount against Pepsi's weaker growth outlook. Still, the beverage giant's strong earnings and cash returns ultimately make it more attractive than pricey Costco stock right now, especially if you're a fan of lower-risk investments.