It should come as no surprise that nearly all investors -- from retail traders to those working at hedge funds -- closely follow the moves of Warren Buffett and his company, Berkshire Hathaway (BRK.A 0.39%) (BRK.B 0.44%).

After all, between 1965 and 2021 Berkshire's stock generated a compound annual gain of more than 20%, while the broader benchmark S&P 500 has only compounded at a rate of 10.5% including dividends. Berkshire's stock has also soundly beaten the market this year.

Part of the reason for Berkshire's outperformance is due to its large equities portfolio, which is currently valued at more than $332 billion. While a lot of investors know about some of the biggest positions in Berkshire's portfolio, such as Apple, what they may not know is that just two consumer staples stocks currently make up a little over 11.5% of Berkshire's entire portfolio.

Let's take a look.

Coca-Cola: $25.6 billion (7.7%) of invested assets

Buffett and Berkshire have plenty of notable names in their equity portfolio, but few have the brand power of beverage giant Coca-Cola (KO 0.15%). Buffett first bought shares of Coca-Cola in 1988 and now it's the fourth-largest position in his portfolio.

When you have a great brand like Coca-Cola, it makes it easier for management to pass its higher costs of running the business on to consumers without too much of an impact on sales, which can enhance the company's ability to weather inflation.

In the third quarter, Coca-Cola management saw success with this strategy, boosting prices by 12% in the quarter. Unit case volume was also up 4%, implying that sales stayed strong despite the price increases. Net revenue rose 10% in the quarter and earnings grew 14%. Furthermore, management raised the company's full-year guidance.

In recent years, Coca-Cola has really focused on building out a strong line of beverages that its customers simply can't get enough of and will always want to drink regardless of whether there is a recession or high inflation. There is still a lot of uncertainty in the environment that could impact demand next year, including a recession, but so far so good.

Kraft Heinz: $13.2 billion (3.9%) of invested assets

Just as you've likely heard of Coca-Cola, you've probably also heard of food conglomerate Kraft Heinz (KHC 1.70%) due to its famous and beloved products, such as Kraft Macaroni and Cheese and Heinz ketchup.

Berkshire currently owns 26.6% of all outstanding shares of the company, so although it's not the biggest position in its portfolio, it's up there in terms of the total stake it owns in the company.

Berkshire first invested in Heinz in 2013, teaming up with 3G Capital to purchase the company for $23 billion. In 2015, Heinz merged with Kraft and shares debuted for around $71. Today, those shares trade for less than $40 and Kraft Heinz is viewed as one of Buffett's largest mistakes, having paid too high a purchase price.

Kraft Heinz has a lot of debt but management has been more aggressively paying it down in recent years. The company has been doing this by selling off business units and lowering its dividend although it still has a healthy 4% annual yield.

There's still a long way to go, but investors are getting more confident about Kraft Heinz's ability to continue to lower debt. The stock trades at less than 15 times forward earnings, which isn't necessarily cheap but also not crazy expensive when you think about some of the brands the company has.