Home Depot (HD 0.02%) has been flourishing as a business as Americans have been putting greater importance on the look of their homes in the past few years, especially since the onset of the pandemic. The home improvement giant's good fortunes of late come on top of the already impressive operating performance it achieved over the past decade.

Along with the improved performance, Home Depot's stock has also performed well and made plenty of investors richer as a result. Indeed, over the last five years, Home Depot stock is up 164%. Let's look at why owning this stock long-term could make you richer as well.

A couple of people fixing up their living space.

Home Depot's stock is trading at a relatively inexpensive price-to-earnings ratio of 23. Image source: Getty Images.

Home Depot is protecting its turf 

The pandemic has changed many people's lives. One of those changes is the increased reliance on remote work, and it is a trend that could very well stick around longer than the pandemic itself. More remote work has made owning a home you don't mind working in more desirable. That increased demand has boosted home prices. It's also boosted the desire to make adjustments to homes already owned and the desire to customize a new home to your liking.

That's good news for Home Depot. As people see their neighbors' home values rise when sold, they get the itch to spend on home improvement and perhaps boost the value of their houses too. These folks are encouraged to spend on upkeep and upgrades.

Home Depot was already doing well before the pandemic hit, growing revenue at a compounded annual rate of 6.9% over the past decade. That helped grow earnings per share at a compounded annual rate of 18.5%. The effects of the pandemic could potentially lift both metrics higher by a few hundred basis points over the next decade.

Another factor contributing to this ability to keep growing as the economy changes has to do with the types of products it sells. In some cases, the size and weight of the items make it difficult for e-commerce competitors like Amazon to gain a foothold in its business. It just can't compete on price when delivery costs are factored in. 

In that regard, Home Depot's 2,298 stores become a competitive advantage, as the company uses them to fulfill online orders and offers convenience to do-it-yourselfers and professionals alike. The physical locations take on extra appeal when time is of the essence, as in an emergency repair that can't wait for delivery. 

Home Depot's stock isn't expensive

Home Depot is really good at what it does. The company has been averaging an operating profit margin of 13.6% in the last decade, and the company continues to work at improving that margin. Home-improvement rival Lowe's (LOW -0.03%) averages 8.5% in the same metric. Whether against outside competitors or its own industry, Home Depot shows it can maintain its lead. 

A chart comparing the price to earnings ratio of Home Depot and Lowe's.

Data source: Ycharts.

Fortunately for potential investors, the stock is not expensive. Trading at a price-to-earnings ratio of 23, it is trading right around where it was five years ago. I noted earlier that Home Depot has delivered a gain of 164% in the last five years. So there's some reason to believe it can continue to deliver good stock performance even at this reasonable valuation.  

The stock does trade at a premium to Lowe's, but that premium is justified considering the better operating margin performance at Home Depot. Overall, Home Depot is an excellent business that's likely to make shareholders richer in the long run.