Costco (COST 1.57%) stock rarely goes on sale. The leading warehouse retailer is prized by investors for its steady market-share gains and its ability to boost earnings through a wide range of selling conditions.

Even now, with the S&P 500 caught in a bear market, Costco shares are outperforming most of its peers. The stock is down 12% through late October, compared to a 20% year-to-date drop in the wider market.

Is that decline a buying opportunity, or will Costco stock likely underperform from here? Let's take a look at some reasons why you might want to add the retailing stock to your portfolio right now.

Costco has market-leading growth

Costco's latest earnings update contained all the hallmarks of an industry-leading business. Sure, growth rates slowed compared to booming results over the last few years. But shoppers continue to prioritize their Costco trips.

Customer traffic was up a solid 5% in the U.S. market in the fourth-quarter period that ended in late August. Those shoppers spent an average of 10% more per visit, too, so comparable-store sales were up a blazing 16%. Back out the impact of rising gas prices, and Costco still notched an impressive 10% increase -- a bit more than Walmart's Sam's Club managed.

Costco has happy customers

Rising customer loyalty is a fantastic signal of a strong business, and Costco is a leader here. A full 92.6% of its members chose to renew their annual subscription this past quarter. That rate was up 0.3 percentage points from the prior quarter, too. In other words, shoppers are becoming more attracted to Costco as prices rise due to inflation.

The chain had no trouble finding new members, either. Costco's customer base grew by 6.5% thanks to a mix of new store openings and subscriber additions at existing locations.

Remember, unlike traditional retailers, Costco gets most of its earnings from subscription fees rather than product markups. That steady flow of profit is valuable in all market environments, but especially during rocky financial times like this.

The discount

These wins help explain why Costco stock is so rarely put on sale in the market. Sure, its current valuation of 0.9 times annual sales is lower than the 1.25 times investors had been paying just a few months ago. But you still must pay a premium to own this stock compared to other retailers like Walmart or Target.

COST PS Ratio Chart

COST PS Ratio data by YCharts.

Buying the stock today also exposes an investor to elevated risks in the short term of a consumer spending slowdown or recession. Costco traditionally does fine in those selling environments, but its sales and earnings outlook is a bit cloudier right now.

In exchange for that risk, you can own a piece of a stellar business that has fantastic long-run opportunities. Consider that the chain hasn't raised its membership fee in several years, for example, and the next boost will certainly flow almost entirely toward the bottom line. Costco's subscriber growth in recent quarters also suggests that it would post market-beating growth even through a recession, should one develop.

That's why investors should consider buying Costco stock today. Yes, a deeper discount might occur if markets take another step lower. But the stock's decline in 2022 doesn't make sense given its bright long-term prospects. Costco was an attractive stock holding in early 2022, and it is even more attractive at today's lower price.