Bill Gates co-founded Microsoft (MSFT 0.37%), a company that is now the second-most valuable U.S. public company. Due in large part to his ownership stake in this business, Gates is currently the sixth-richest person in the world, according to Forbes. And with a portion of his fortune, Gates and his now ex-wife Melinda sought to make a difference in the world via the Bill & Melinda Gates Foundation.

On its website, the Bill & Melinda Gates Foundation states, "We are a nonprofit fighting poverty, disease, and inequity around the world." With its vast resources, the foundation is trying to eradicate malaria, provide clean water, and feed malnourished children, among other things. 

Of course, nonprofit work like this is costly. Gates provided much of the funding for the foundation. But another major benefactor is Gates' longtime friend Warren Buffett, chairman of Berkshire Hathaway (BRK.A -0.28%) (BRK.B -0.68%) and the fifth-richest person in the world. And given how important Buffett is to the foundation, it may be surprising to learn that it just sold 20% of its stake in Berkshire Hathaway stock.

In reality, there's nothing surprising about it, as we'll see.

Why sell Berkshire Hathaway?

The Bill & Melinda Gates Foundation has a trust fund, in which it owns Berkshire Hathaway stock. As a fund, it discloses its holdings quarterly. In February, the foundation had almost 24.7 million shares of Berkshire Hathaway. However, in its May 15 filing, it disclosed that it now has 19.7 million shares.

Considering Gates is close friends with Buffett, selling Berkshire stock could give investors the wrong idea.

In reality, Gates doesn't make investing decisions. Rather, Michael Larson has managed Gates' personal investments since 1994 and started managing investments for the foundation a few years later. It was Larson, therefore, who sold Berkshire stock, not Gates.

Moreover, Buffett didn't donate cash to Gates' foundation. Rather, he has donated his personal shares of Berkshire over the years. Because of this, Berkshire was the second-largest position in the foundation's portfolio before this quarter.

There's no need to believe that Gates or the foundation is bearish on Berkshire's forward prospects. Indeed, it's still the third-most valuable position in the fund's portfolio.

The top three stocks now

The top stock in the Bill & Melinda Gates Foundation's portfolio is Microsoft. Thanks to Gates' donations, the foundation owns 39.2 million shares of the tech giant, which are valued at about $11.3 billion and provide over $100 million in annual dividend income for the foundation to work with. This position is unsurprising.

More surprising perhaps is the Bill & Melinda Gates Foundation's second-largest position, which is Canadian National Railway (CNI -5.05%). However, anyone who tracks changes in the foundation's portfolio isn't surprised at all -- the foundation has held a position in Canadian National Railway for over 20 years.

Finally, Berkshire Hathaway has now slipped to the third-largest position in the Bill & Melinda Gates Foundation's diversified portfolio. Only one other position in the portfolio went down in the most recent quarter: its position in grill company Weber, which was taken private, explaining why it's no longer in the portfolio.

Berkshire Hathaway doesn't pay a dividend, which may be why Larson is reducing this position instead of positions in other companies. Consider that the fourth-largest portfolio position is Waste Management. For its part, Waste Management has paid and increased its dividend for 20 straight years, which is likely attractive to a fund that needs cash to fund its various ambitious projects around the world.

Indeed, of the 22 positions in the Bill & Melinda Gates Foundation's portfolio, only six don't pay a dividend. And except Berkshire, the other five are relatively small positions.

What can investors learn from this?

Investors may not want to draw too many conclusions from changes in a hedge fund's portfolio. Each fund has unique goals and circumstances that will be different from your own.

The much bigger takeaway is how to think about risk in the stock market. As a nonprofit, the Bill & Melinda Gates Foundation is likely primarily concerned with preserving wealth. And that's likely why Larson has focused on dividend-paying stocks.

Not all dividend stocks outperform the average for the S&P 500. Indeed, if you bought shares of Canadian National Railway 10 years ago, you're losing to the market. However, over the last decade, shares have never traded more than 10% below where they traded 10 years ago. And that's some nice stability for anyone concerned with capital preservation.

However, if you're looking to grow your capital, you may need to learn to embrace more volatile returns. The best stocks periodically experience large drawdowns. And that's OK, so long as you're prepared to stay the course.