Companies with demonstrable competitive advantages in profitable industries are likely to do well over the long haul. That's part of what makes buying and holding high-quality dividend stocks and reinvesting the dividends a simple yet effective recipe for success as an investor.

Home improvement retailer Home Depot (HD -0.60%) and snack and beverage giant PepsiCo (PEP 1.18%) are two wonderful stocks that I believe could position their shareholders for early retirements. Here's why.

1. Home Depot

In North America especially, home ownership is a source of pride and a symbol of the American dream. This helps explain why the continent boasts a $900 billion home improvement retail market. And Home Depot sits atop this massive industry, ahead of No. 2 Lowe's and privately held Menards.

A $10,000 investment in Home Depot made 10 years ago with dividends reinvested would now be worth more than $72,000 -- giving it an average annual total return rate of 21.9%. Investors should probably moderate their expectations on that front, however. The company's annualized diluted earnings per share growth was 17.9% over the last decade, but analysts expect it to slow to 15.7% over the next five years. 

The forecast deceleration in Home Depot's growth comes down to two factors. First, its sheer size will make it more difficult for the company to move the growth needle as much as it did when it was somewhat smaller. And rising interest rates and elevated materials costs will continue to weigh on residential construction for the foreseeable future. 

At the current stock price, Home Depot's dividend yields 2.5%, which is meaningfully above the S&P 500 index's 1.6% yield. With the dividend payout ratio set to be 46.2% this fiscal year, investors can rest easy knowing that the company can cover that payout comfortably. This both provides a buffer for the dividend if an economic downturn cuts into earnings and leaves it with funds to reinvest in growing the business. 

Best of all, Home Depot's valuation appears to be reasonable. The stock's forward price-to-earnings ratio of 18.4 is only moderately higher than the average of 16.4 in the home improvement retail space. For this best-of-breed company, that's hardly an excessive premium. 

A businessperson prepares financial reports.

Image source: Getty Images.

2. PepsiCo

With a portfolio of snack and beverage brands that includes Lay's, Gatorade, and the eponymous Pepsi-Cola, PepsiCo's brands are consumed and enjoyed by people around the world more than a billion times a day. 

A $10,000 investment in the stock a decade ago with dividends reinvested would now be valued at over $32,000 -- a 12.5% average annual return rate. Global population growth, new product launches, and acquisitions pushed the company's profitability much higher during that time, which largely contributed to its strong returns.

And since these factors are expected to persist, analysts believe that PepsiCo will generate 7.9% annual earnings growth over the next five years. The company's market-beating 2.6% dividend yield should also satisfy the appetite of income investors. Best of all, PepsiCo's dividend payout ratio is expected to be 66.7% in 2022. This should allow for high-single-digit percentage dividend growth annually in the medium term.

The stock looks poised to produce annual total returns in the low double-digit percentages for investors over the next five to 10 years. And PepsiCo's forward price-to-earnings ratio of 26.4 isn't prohibitively expensive for investors with long-term horizons.