Berkshire Hathaway (BRK.A -0.10%) (BRK.B -0.09%) has been one of the most successful long-term investments in history, and CEO Warren Buffett has earned a reputation as one of the best investors of all time. Early shareholders have become multi-millionaires, and even those who purchased shares more recently have enjoyed substantial gains over time.

Yet what many might find surprising is that there's another well-known billionaire that has a much different relationship with Berkshire Hathaway. For years, this tech pioneer has been selling off Berkshire stock. Some shareholders believe that his sales have hurt the company's stock price, but Buffett himself not only seems unconcerned with it but also even continues to make it possible for those actions to keep happening.

Here, we'll take a closer look at the story behind the biggest Berkshire stock seller of all time.

Warren Buffett with several photographers nearby.

Image source: The Motley Fool.

A billionaire relationship with stock sales at its core

It was back in 2006 that Buffett himself set in motion the events that would eventually lead to these massive sales of Berkshire stock. That's when the Oracle of Omaha first announced his plans to donate what was then an estimated $31 billion to the foundation run by Microsoft (MSFT 0.22%) billionaire founder Bill Gates and philanthropist Melinda Gates. Buffett's involved making gradual gifts of 85% of his Berkshire Hathaway holdings to several different foundations, with the Gates Foundation getting by far the biggest chunk of the stock. As part of the gift, Buffett took a spot on the Gates Foundation board.

The initial gift of 25 million Berkshire Class B shares was worth about $1.5 billion at the time, but it was just the first in an ongoing series of annual gifts. In 2007, the Gates Foundation's holdings in the stock rose to 48.75 million shares, with further donations coming each year.

At first, the billionaire couple seemed content to have the foundation simply hold on to those shares. However, beginning in 2008, the foundation started making regular sales of the donated Berkshire stock through open-market transactions. The sales proceeded at a rate of almost exactly 10 million Class B shares per year in 2009 and 2010, and then accelerated to what has been a steady 20 million share per year rate from 2011 until now.

Being prudent with charitable funds

At first, it might seem like a mistake for the billionaire couple and their foundation to have sold off its holdings of Berkshire stock. After all, over the past decade, those Class B shares have risen in value nearly fourfold.

Yet charitable foundations have a fiduciary duty to the public to invest their assets prudently, and part of prudent investment principles involves diversification. No matter how unlikely it might be for Berkshire Hathaway to suffer a catastrophic setback that would crush its stock's value, that theoretical possibility is a risk for those who oversee the investment of the foundation's assets. Diversifying into a broader set of investments meets those fiduciary duties.

At the same time, though, it's in the Gates Foundation's best interest not to do anything to harm the value of the assets that it's received. That explains the method that the foundation has used to sell off portions of its Berkshire stock holdings, making almost daily sales that at current prices raise almost $4 billion per year in proceeds for the foundation's charitable purposes. Indeed, the foundation has been upfront in publicizing its plans for the sales, making it clear exactly what it's doing -- and that it has Buffett's approval in doing so.

Check out the latest earnings call transcripts for the companies we cover.

There's more where that came from

Despite all the sales, the Gates Foundation is far from running out of Berkshire Hathaway stock to sell. That's because the ongoing gifts that Buffett has made have generally replenished the foundation's position in the stock. With more than 55 million Berkshire shares in its investment portfolio, the Gates Foundation still has roughly $11 billion of its assets invested in Buffett's company -- and future gifts will continue to have a positive impact on its ability to fulfill its mission.

Usually, big sales of a stock will put big downward pressure on its price. But given the extent to which Warren Buffett has explained exactly what he's doing, Berkshire shareholders in general should be comfortable that despite ongoing sales from the Gates Foundation, their investment has further to grow in the long run.