Investing in the stock market is one of the best ways that people can grow their wealth. Over many decades, the results that the S&P 500 can produce can be truly extraordinary.

But there is one business in particular that has absolutely crushed it for investors, much more than the overall market. Since its initial public offering in 1981, this top retail stock has generated a total return of 3,000,000%, which would have turned a $1,000 investment into an astonishing $30 million today. That's an incredible gain.

Continue reading to learn what company I'm talking about, its ascent over the years, and whether it's a smart investment to make today.

Dominating the industry

Investors should understand that it's not a technology or internet enterprise that has been such a huge winner. The business operates in the boring home-improvement sector. It's Home Depot (HD 0.03%), the industry heavyweight.

This business hasn't changed much since the early days. Home Depot sells various supplies and tools to DIY and professional customers to help them handle renovation projects. Its current scale is truly remarkable. As of Feb. 20, there were 2,335 stores in total, which are on average over 100,000 square feet in size. What's even more impressive is that there is a Home Depot location within 10 miles of 90% of the U.S. population, demonstrating its wide reach.

It wasn't always this way, though. About 30 years ago, the company only had 264 stores open. And in fiscal 1993, Home Depot registered $9 billion in revenue, a fraction of the roughly $153 billion it posted last fiscal year.

The early executive team made the correct call that the best strategy was to rapidly expand the store footprint across the U.S. Over the decades that followed, Home Depot continued growing its sales base and profitability, which undoubtedly helped drive those outstanding shareholder returns.

Home Depot has become such a financial success story that it is now able to return incredible amounts of capital back to investors. Making $21 billion in operating cash flow in fiscal 2023 allowed management to pay $8 billion in dividends and to repurchase $8 billion worth of outstanding stock. These capital allocation decisions are a usual occurrence these days.

Should you buy Home Depot shares today?

Buying stocks based on their historical performance isn't necessarily a sound strategy. Businesses mature, and their opportunities for growth start to diminish. I think this is definitely the case with Home Depot.

To be fair, though, the stock has doubled in the past five years, including dividends, which is a solid gain. But shares are 16% off their all-time high.

At its current size, it's reasonable to assume slower sales gains going forward. That's only a natural progression. The struggles have been real in recent times, too. Revenue fell last year, and it is projected to rise by just 1% in fiscal 2024. Demand from consumers to tackle bigger renovation projects just isn't as robust in the current uncertain macro backdrop, one characterized by higher interest rates and inflationary pressures.

But I still believe Home Depot is a worthy investment candidate for those who can look out over the next five years. The business has competitive advantages working in its favor, namely its scale and brand recognition. Even smaller rival Lowe's can't match Home Depot in this area. It also operates in a massive industry, giving it the opportunity to steal share from smaller shops in the fragmented market.

Investors who can look past near-term headwinds should consider buying shares. Home Depot's returns won't resemble the past, but they could provide a boost to your portfolio.