It's natural to fear that you've missed out on most of a stock's gains if the price has run up significantly. However, it's never too late to buy a company that still has good earnings potential.

Costco Wholesale (COST 1.01%) has performed well, and its share price has had a strong run-up over the years, including a 40% gain over just the past year alone. Are the shares still a buying opportunity?

That takes work to uncover. It's time to dive into the company's business to see whether its prospects remain bright.

A shopper in a warehouse.

Image source: Getty Images.

Simple business, strong execution

For the uninitiated, Costco offers a unique shopping experience. Members pay an annual fee to shop at its large warehouses, where it sells a vast array of high-quality goods and services. The merchandise often comes in large sizes and offers members a value proposition since they have low unit prices.

Looking at renewal rates and membership growth, consumers continue to find the fee an attractive value proposition. Renewals have consistently hovered around 90%, including 90.5% in the first fiscal quarter, which ended Nov. 26. There were 72 million paid members, up from 71 million at the end of the previous fiscal year.

Costco also has room to expand its number of warehouse stores. Management has been steadily opening new locations over the years. It ended last year with 861 locations and opened 10 during the first quarter.

It also operates profitably. Costco's operating income grew by 13.3% in the first quarter to $2 billion.

Rewarding shareholders

These large profits translate into free cash flow (FCF). Last year, Costco generated $6.7 billion -- plenty to pay $1.3 billion in dividends. The stock has a 0.6% dividend yield, less than half the S&P 500's 1.4%. That may turn off some investors, but there's much more to the story.

The board of directors has raised dividends annually for a number of years. More importantly, they've declared large special dividends every few years. Most recently, the board saw fit to pay a $15 dividend last month.

High expectations

Costco's success isn't a secret among investors. Strong customer loyalty, profitable store growth, and consistently higher profitability have led to an ever-increasing share price. That means you'll pay up to buy the shares. Costco's price-to-earnings (P/E) ratio stands at 49. That's much higher than the S&P 500's P/E multiple of 27.

But as Warren Buffett said, "It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price." While the share price might seem expensive, Costco certainly qualifies as a wonderful company.

Everyone wants to buy a company like Costco at a low P/E multiple. However, as management continues to execute its simple but effective strategy, long-term holders will look back and undoubtedly feel pleased with their purchase, even if the stock price fluctuates in the short term.