Consumers are looking to save money on essentials today, and that behavior is putting a new spotlight on price leaders like Costco Wholesale (COST 1.01%) and Kroger (KR -2.28%). These retailers tend to perform well during inflationary times since they offer a good mix of value-based staples and more indulgent purchases. Both companies have a huge, engaged shopper base, too, which helps explain why their stocks are beating the market so far in 2022.

But which one is the better buy going forward? Kroger is much cheaper, while Costco promises more stable earnings. Let's take a closer look at the key differences between the stocks.

Growth trends

Their latest sales trends illustrate why Wall Street has favored these stocks in a down market in 2022. Kroger said in early September that second-quarter comparable-store sales rose 6%, which was good enough to convince management to raise its 2022 outlook.

Kroger now sees comps rising between 4% and 5%, in part because shoppers are loving its fresh produce section. Its main competitor, Walmart, seems to be growing a bit faster and taking some market share, though, as shoppers tilt more spending toward groceries and away from categories like home furnishings.

Costco is faring better, both in absolute terms and when compared to key rivals. Comps were up 7% in the 9 weeks that ended in late October, for example. BJ's Wholesale reported just a 5% comps boost in the quarter that ended on Oct. 29 .

Earnings power

Investors will also prefer Costco stock when judging earnings power. Both retailers operate at extremely low operating margins at just about 3% of sales. But most of Costco's earnings come from membership fees rather than the markup it charges on product sales.

That factor makes its profits much more stable during economic downturns. It also means Costco significantly boosts annual earnings each time it raises subscription prices, as it does roughly every 5 years.

Kroger is planning to boost its margins over time through initiatives like a push into ultra-fast e-commerce delivery. And the grocery store chain pays out a higher dividend yield. But Costco is the winner with respect to stable earnings growth.

The better buy

Investors are being offered a big discount for Kroger shares as compared to Costco's. You must pay about 0.25 times annual sales to own the supermarket chain compared to a price-to-sales (P/S) ratio of 1 for Costco and 0.7 times sales for Walmart.

COST PS Ratio Chart

COST PS Ratio data by YCharts

Kroger is also the cheapest option on a price-to-earnings (P/E) valuation. Its P/E of 15 can be considered a major discount compared to Costco's P/E of over 40.

Considering its higher dividend yield, Kroger's stock might appeal to value-focused investors. However, Costco's business has a few factors that make it a more attractive option. It is winning market share, growing more quickly, and likely to generate stable and growing earnings over the next several years even if consumer spending trends stay volatile.

Those are all great reasons for the stock to be priced at a premium compared to Kroger and other retailing peers. Those factors also point toward continued market-thumping returns ahead for shareholders who simply hold onto this stellar retailing business over the long term.