Warren Buffett is considered one of the greatest investors of all time. A value investor at heart, his shrewd business sense and calm during market corrections have rewarded Berkshire Hathaway shareholders handsomely.

One ingredient to Berkshire's secret sauce is simply finding good companies and holding them over time. Here's the reasoning behind Berkshire holding Coca-Cola (KO) and American Express (AXP -0.62%) for over 30 years and the value in finding quality dividend stocks and holding them over multi-decade periods.

A person stacking coins into glass jars that sprout larger plants the more coins fill the jar illustrates the concept of compounding wealth over time.

Image source: Getty Images.

"Buy and hold" at its best

Berkshire first bought Coca-Cola in 1988 and American Express a few years later in the early 1990s. Buffett and his team purchased both stocks in stages. Still, both companies have produced a higher total return than the S&P 500 since 1988 and have made their investors phenomenally wealthy.

KO Total Return Level Chart

KO Total Return Level data by YCharts.

Today, Berkshire Hathaway's American Express and Coca-Cola positions are worth over $57 billion. But Berkshire's cost basis on both stocks is just a few billion combined. Both companies have been above-average investments but not exceptional ones.

As Buffett wrote in his 2023 annual letter, discussing the qualities that make good dividend stocks, why American Express and Coca-Cola have worked well for Buffett, and why sticking with a good company over time is the easiest way to compound wealth: "The lesson from Coke and AMEX? When you find a truly wonderful business, stick with it. Patience pays, and one wonderful business can offset the many mediocre decisions that are inevitable."

The performance shows the impact of patience and how buying and holding quality companies over a multi-decade time frame can produce excellent returns.

The power of compounding

The S&P 500 has produced an average annual return of 10.2% over the last three decades. Although the annual returns tend to be far above or below 10% in a given year, the 10% base of reference is still good to know.

You may be surprised to learn that $100 invested at a compound annual growth rate of 10.2% for 35 years will increase by -- wait for it -- 30-fold to $3,000. This is more or less what has happened with Berkshire's American Express and Coke positions. It's not so much about the return as it is about time.

If you wanted to increase your investment by 30-fold in just 10 years, you'd have to average a return of over 40% per year. And that assumes consistently huge gains and no losses -- which is unrealistic. The key takeaway is that regular saving and giving investments time to grow can turn a good company into an engine for powering generational wealth.

Focusing on dividends and buybacks

If you go back and read the last few years of shareholder letters, you'll notice a common theme: Buffett loves a strong business that grows its dividend and buys back its stock. You can see this dynamic at play in the following chart.

American Express, Coke, and Apple have all repurchased a lot of stock and raised their dividends significantly. This X pattern is what you'll want to look for when it comes to buybacks and dividends.

AXP Shares Outstanding Chart

AXP Shares Outstanding data by YCharts.

One reason Buffett hasn't felt pressured to buy more shares of American Express and Coke in recent years is because of buybacks. Today, Berkshire owns 20.9% of American Express and 9.3% of Coke. But it hasn't always been that high of a stake.

For instance, American Express has reduced its share count by 31.7% over the last 10 years from about 1.06 billion shares outstanding to 724 million. With about 152 million shares, Berkshire owned just 14.3% of American Express 10 years ago.

American Express has repurchased its shares but from other investors and not Berkshire. So, with fewer shares to go around, Berkshire has managed to increase its stake in the company without buying more shares -- not to mention collecting billions in dividend income in the process.

Buffett has made the same argument for why Berkshire isn't in a rush to boost its Apple stake. Today, Berkshire owns 5.9% of Apple. But at the rate Apple buys back its stock, Berkshire could eventually own 7% or even 8% of the company 10 years from now without buying another share.

Play the long game

Berkshire has invested far more capital in newer holdings, like Occidental Petroleum and Chevron, than in Coke or American Express. Coke and American Express are staple holdings in Berkshire's portfolio, not because Berkshire invested a ton in either company but because it was patient enough to hold these stocks over time.

Now, it's worth mentioning that you shouldn't expect the same returns from these companies going forward. When Buffett bought these stocks, there was far more uncertainty. Today, Coke, American Express, Chevron, Apple, and other Berkshire holdings are all components of the Dow Jones Industrial Average. The story has largely been told, so the monster gains are in the past.

Replicating Buffett's success with both companies would take finding a smaller business with a multi-decade runway for organic growth and dividend growth. Investors who don't need explosive gains may do well to invest in proven companies. The Dow and Berkshire's holdings are excellent places to start if you're looking for ideas.