Albert Einstein once said, "Compound interest is the eighth wonder of the world." Compound interest, of course, being the ability to earn interest on your investment, then reinvest that interest at the same rate of return. Given a long enough time period, compounding can lead to absolutely massive gains.

For a stock, if a company can reinvest its earnings at a similar high rate of return, that can lead to likewise jaw-dropping outperformance. This of course is the strategy touted by Warren Buffett and especially his late partner, Charlie Munger.

But as the miracle of compounding only works over time, that's why it's so important to buy stocks with long-term staying power. Perusing Buffett's current Berkshire Hathaway (BRK.A 0.72%) (BRK.B 0.51%) portfolio, here are two current holdings primed for strong long-term compounding and stockholder returns.

Amazon

Amazon (AMZN 3.20%) is known as a tech and e-commerce behemoth, but the company is only 30 years old, which is not long in the grand scheme of American corporate life.

What gives Amazon staying power? Two things: Its excellent corporate culture, as well as its first-mover competitive advantage in the fields of both e-commerce and cloud computing.

Those two industries are difficult and complex to execute, which helps keep competitors at bay and decreases their chances of catching up. But that complexity has also led to some problems in 2022 and the first part of this year. During the pandemic, Amazon doubled the size of its already-giant fulfillment and distribution platform, making it unwieldly to manage. In addition, cloud customers sought to aggressively cut their computing costs after the pandemic as interest rates rose.

But in 2023, Amazon has done what always has done in times of adversity. That is, adapt and get stronger.

In e-commerce, the company underwent a structural change, reorganizing its U.S. footprint into eight distinct semi-autonomous regions, with analytics predicting the inventory each region would need. That greatly helped to decrease shipping times from the former model, when goods had to be shipped long distances across the country. The result has been a steady improvement in e-commerce profitability this year, and at greater scale.

In cloud computing, Amazon Web Services responded to the slowdown by helping customers lower their cloud bills as much as possible, but increasing customer loyalty in the process. That has lowered AWS's growth rate this year, but as CEO Andy Jassy explained on the conference call with analysts, many customers are trading savings for longer-term commitments, with many switching from pay-as-you go contracts to longer-term one-to-three year commitments, trading costs for greater commitment to Amazon's cloud.

AWS is also innovating quickly in artificial intelligence. While most of the attention has gone to OpenAI and ChatGPT, owned by Amazon's main rival, Amazon's platform actually has the widest variety of large language models for customers to use. These include some of Amazon's own "Titan" models, models from Anthropic, with whom Amazon just invested up to $4 billion, as well as models from other start-ups AI21 Labs, Cohere, Stability AI, and the Llama2 model from Meta Platforms. Given the turmoil we've seen at OpenAI over the past month and the fast pace of innovation across the space, that variety and scale will likely be an advantage for Amazon's leading cloud platform going forward.

Last quarter was the first since the fourth quarter of 2021 that AWS growth did not decelerate, suggesting the cloud market may be bottoming. And with Amazon having done right by its customers through this downturn, look for AI-fueled growth to pick up in 2024 and beyond.

Mastercard

As Amazon is only one of a couple large companies that can afford to compete in its industries, Mastercard (MA -0.22%) is one of only two large global credit and debit card networks serving third party issuers across the world, in over 180 countries. That massive duopoly amid increasing card-based payments adoption has led to incredible outperformance for Mastercard since its IPO in 2006.

MA Total Return Level Chart

MA Total Return Level data by YCharts

Even 57 years after its founding and 17 years after its IPO, Mastercard is still finding ways to grow above the level of GDP. Last quarter, revenue grew 14%, or 11% in constant currency. And because Mastercard has relatively stable fixed costs for its giant global card network, a lot of that growth falls straight to its bottom line. As a result, operating income growth came in at 21% in the third quarter.

How has Mastercard been able to keep up such growth? Well, the ongoing "war on cash" continues even to this day, with a greater and greater percentage of global payments handled by credit and debit accounts on top of Mastercard's network "rails." This goes not only for customer-to-merchant payments, but also new payment use cases such as business-to-business flows and cross-border payments.

In addition, Mastercard has been able to develop new-age fraud detection and cybersecurity intelligence solutions, through both internal development and bolt-on acquisitions. These services help increase payment approvals while limiting fraud, leading to a win-win for customers that buy them. For instance, on its recent conference call, management noted that just one of its security products, SafetyNet, prevented $20 billion in fraud over the past 12 months alone.

Last quarter, these value-added services increased by 17%, making up 36% of revenue. And given Mastercard's scale and data advantage, look for these value-added services to get even better in the age of AI, as data-driven insights continue to get more accurate and valuable to businesses worldwide.

All in all, Mastercard has an entrenched position that generates high profit growth, with a culture of innovation and long growth runway ahead of it.