Investors have high expectations for Costco Wholesale (COST 1.01%) stock ahead of the company's upcoming earnings report. The warehouse retailing giant is outpacing the broader market's rally through mid-September, with returns exceeding 20% so far in 2023.

These levels of gains are typically associated with a bull market, which might be on the way if the U.S. economy manages to avoid a recession over the next few quarters. But Costco is an attractive investment partly because of its ability to grow earnings through a wide range of selling environments.

With that competitive advantage in mind, let's look at three reasons to like this stock as Costco prepares to close out its fiscal year on Sept. 26.

1. Costco potentially handles higher traffic

Costco sells both consumer staples products and discretionary items like jewelry and home appliances. This diversity sets it apart from peers like Walmart (WMT -0.08%) and Target (TGT 0.18%), which tend to focus more on one niche or the other. Target's sales have declined in recent quarters, for example, as shoppers shifted their spending away from things like home furnishings.

Costco also felt a pinch from this development but has continued growing its business. Comparable-store sales in August were up 4% overall and rose by 3% in the core U.S. market.

Costco's late-September earnings announcement will add context to this point in the form of customer traffic trends for fiscal Q4. Look for continued solid gains here given that traffic was up a healthy 4% in the previous quarter. For context, chief rival Walmart posted a 3% traffic increase for fiscal Q2.

2. Costco could boost fees soon

Costco gets most of its earnings from its steady flow of membership fees, and there are several reasons why this selling approach benefits shareholders. There's much less volatility around profits, for one, since they don't depend as much on steady sales trends. The chain likely won't report declining margins due to the shift toward more consumer essential products, either.

COST Operating Margin (TTM) Chart

COST Operating Margin (TTM) data by YCharts

Yet Costco is also due for an increase in its annual membership cost because it has been over five years since the last raise. This boost will provide an immediate jolt to its finances, and potentially the stock price.

But investors shouldn't expect to see earnings jump. Costco executives have made it clear that they intend to pour all excess cash into extending the retailer's pricing advantage. That's the right call for long-term growth because it helps ensure that Costco keeps winning market share from peers who don't benefit from its scale and cost advantages.

3. Costco is posting record renewal rates

The main metric I'll be watching in Costco's late-September earnings report is the chain's renewal rate. That core growth figure has been holding steady at record highs of over 90% in recent months. A similarly strong result this quarter would confirm that shoppers remain highly engaged even as they shift their spending habits around. It would be more evidence that Costco has room to raise its membership fees, too. And it would imply growing market share through today's challenging selling environment.

Costco's stock rarely looks cheap, and the current price is no exception. Investors have to pay roughly 1 times annual sales for shares of the retailer, compared to 0.7 times sales for Walmart. That premium is well deserved, though, given Costco's more stable earnings and its strong track record for growing sales whether consumers are focused on value or seeking to splurge during cyclical upturns.

There's no telling when that next sustained bull market upswing will arrive. But Costco stock is likely to generate solid returns through whatever retailing environment develops in the months and years to come.