Costco Wholesale (COST -0.54%) has been a fantastic long-term investment. Over the past decade, the company's share price gains have more than doubled the S&P 500's returns.

More recently, Costco has caught investors' attention for two important reasons: Its stock has been a great pandemic play, and the company has continued to add new members quickly. Let's take a closer look at both. 

A person pushing a shopping cart.

Image source: Getty Images.

1. Costco knows how to grow and retain members

One of the reasons investors have been talking so much about Costco stock is because the company has done a fantastic job of growing and retaining those members. The company ended fiscal 2021 with 61.7 million paid households -- an increase of 13% from just two years earlier. 

Costco's membership growth is off to a strong start in fiscal 2022 as well, with the company adding another 800,000 members in the first quarter (reported on Dec. 9).

Just as important to Costco's membership growth is the company's ability to retain its members. Membership retention has been about 90% for many years, and in the most recent quarter membership renewals in the U.S. and Canada were a very impressive 91.6%. 

Costco says its retention rate is benefiting from an increase of its executive memberships -- which renew at a higher rate than other memberships -- and because many members have opted to have their memberships automatically renew. 

2. Costco has been a great pandemic play

Another reason Costco's stock has got investors talking is because it's been a great investment, even during the pandemic. Since January 2020, Costco's stock has put up returns of 93%, compared to the S&P 500's 48% gains.

Costco's share-price spike has come as it has put up some very impressive sales figures. Costco's comparable sales jumped 15% in its U.S. stores and popped 19% at its international locations in fiscal 2021.  

Additionally, the company's fiscal 2021 net income soared 25% to $5 billion. 

Why all the growth? Because as people spent more time at home over the past two years, some of them have relied on Costco for their household shopping needs -- for everything from desks to diapers.  

During the pandemic -- and even with high inflation right now-- members still view Costco as great place to stock up on essentials. 

A good bet in good times and bad

The great news for Costco investors is that even when the pandemic is in the rear view, the company still has lots of potential to continue growing. 

Costco's business still performs well when the economy is strong and inflation is low, when people are more apt to spend money on big-ticket items like big-screen TVs. 

All of this means that while investors are talking about Costco's stock right now because it has benefited from the pandemic, there's no indication the company is slowing down anytime soon.