Berkshire Hathaway (BRK.A -1.29%) (BRK.B -1.41%) owns a portfolio with dozens of stocks in it, many of which were selected by its legendary CEO Warren Buffett. Here are three in particular that have attracted billions of Berkshire's capital in recent years that could be worth a closer look.

The bank Buffett is sticking with

Berkshire Hathaway has sold several bank stocks in recent years. It completely unloaded its once-massive stake in Wells Fargo (NYSE: WFC) and has also sold JPMorgan Chase (NYSE: JPM), Goldman Sachs (NYSE: GS), U.S. Bancorp (NYSE: USB), and several others.

But there's one bank Buffett is still willing to invest a large amount of money in -- Bank of America (BAC -1.80%). Berkshire owns more than 1 billion shares of Bank of America (BofA), a 13% stake in the company worth about $29 billion. In fact, Berkshire bought over $600 million worth of Bank of America in the first quarter of this year alone.

Buffett has spoken several times about the qualify of Bank of America's management team, and the bank continues to deliver strong results even in the challenging rising-rate environment. With shares trading for 10% less than book value, it wouldn't be a shock to see Berkshire's position grow even further.

Like looking in a mirror for Buffett -- well, sort of

Markel (MKL -0.02%) has been referred to as a "Baby Berkshire" for years among investors, and for good reason. Like Berkshire, it is an insurance company at heart, with a large specialty and reinsurance operation. Its insurance business typically produces a healthy underwriting profit and also provides investment capital. Also like Berkshire, Markel invests its capital in ways that go beyond what the typical insurance company does.

First, Markel has a stock portfolio that owns over 100 publicly traded stocks (including Berkshire Hathaway). And one of the most interesting aspects of Markel is its third component, Markel Ventures, where the company invests in early-stage and smaller businesses.

Markel Ventures is significantly different from Berkshire, as Markel is roughly 2.5% of Berkshire's size and can therefore get meaningful gains from smaller investments that would barely move the needle at Berkshire.

Buffett seems to agree. He has been building a stake in Markel in recent quarters, with Berkshire now owning 3.5% of its younger sibling.

Buffett's favorite stock to buy (in recent years)

What is Buffett's favorite stock? There's no way to know for sure, but some investors might assume it's Apple (NASDAQ: AAPL). After all, Buffett has said Apple has the best business in Berkshire's portfolio.

However, that doesn't mean that Buffett thinks Apple's stock is the best value in Berkshire's portfolio, and his recent spending backs that up. In fact, Warren Buffett's favorite stock to buy -- based on the amount of money he's invested -- is Berkshire Hathaway itself. Since Berkshire modified its stock-buyback plan in mid-2018, Buffett and his team have allocated $66 billion of the company's capital to buying back its own shares.

This clearly indicates that both Buffett and Vice Chairman Charlie Munger think the stock is a good value, as this is the main basis for the buyback plan these days. For everyday investors, Berkshire is like a well-diversified portfolio in a single stock.

Are they right for you?

It's never a great idea to buy a certain stock just because a billionaire did -- even if that billionaire is Warren Buffett. However, these are three well-run businesses trading for attractive valuations, and there's a solid long-term investment case to be made for all of them.