Berkshire Hathaway (BRK.A -0.38%) (BRK.B -0.74%) owes much of its success to the prowess of its chief executive officer, Warren Buffett. With a long-term investing strategy that emphasizes finding top-quality companies and owning their shares as long as possible, Buffett has been able to put the power of time and compounding to work in building an immense fortune for his shareholders.

Every year, Buffett catalogs his investment prowess in his annual letter to investors. Even though the Berkshire CEO has branched out recently and added positions in new companies, it's interesting to see that the three stocks that have given him the biggest percentage gains tend to stay the same year after year. Here, we'll look at the top three performers in Berkshire's portfolio to try to discover the secret of their success.

3. American Express

American Express (AXP 0.21%) has a long history with Buffett, with his initial investment dating all the way back to the days of the Buffett Partnership in the 1960s. Berkshire's current position in the charge card company started in 1994, with a substantial purchase of nearly 10% of AmEx's outstanding shares. Over time, that stake has built up to nearly 19%, and an initial outlay of $1.29 billion is now worth almost $18.9 billion, for a gain of 1,367%.

American Express still stands out from its fellow payment network rivals by catering to higher-end clients, with membership privileges that cardholders are willing to pay pricey annual fees to obtain. With recent efforts to build out its mobile platform while retaining its leadership status in commercial payments, American Express refuses to rest on its laurels and recognizes the need to keep up with the latest innovations in the payments space. That should bode well for Berkshire's position going forward.

2. Coca-Cola

Berkshire's stake in beverage giant Coca-Cola (KO 1.60%) goes back even further than its American Express position, with Buffett having started to buy shares of Coke back in the late 1980s. Taking advantage of low prices following the stock market crash of 1987, Buffett added more shares in 1994 but has since left the position unchanged. In total, Buffett spent just under $1.3 billion for his Coca-Cola shares, and they're now worth a whopping $22.1 billion, for a gain of 1,604%.

Semi trailer with bottles of Coca-Cola on side.

Image source: Coca-Cola.

Coca-Cola has faced some tough times in recent years, as consumer preferences moved away from its namesake sugary soft drinks. However, the beverage giant was able to pivot effectively by coming out with new product lines including water, tea, juice, and low- or no-sugar soft drinks. With a healthy dividend yield approaching 3%, Coca-Cola continues to pay off for Buffett and Berkshire's shareholders.

1. Moody's

Surprisingly, Buffett's biggest success has come from credit rating agency Moody's (MCO -0.26%). Having first gotten shares in 2000 following Moody's spinoff from Dun & Bradstreet, Berkshire's cost basis in its Moody's position is just $248 million. However, the stake is currently worth almost $5.9 billion, for a total return of 2,262%.

The interesting thing about Buffett's treatment of Moody's is that his gains could have been even larger if he had followed his usual precepts about holding onto his positions as long as possible. During the financial crisis, Berkshire actually sold significant portions of its Moody's stock, as concerns swelled over the credit rating agency's possible role in the rise and fall of the housing market. Had Berkshire held onto those shares, it would have seen even larger gains. Nevertheless, Buffett still has a 13% stake in Moody's, and it's done extremely well for the insurance giant's overall results lately.

Think long-term

Warren Buffett's experience highlights the value of having a long-term investing strategy. By letting your best winners keep running, you can squeeze every penny of profit you can from your portfolio -- all while setting the stage for even further gains down the road.