Berkshire Hathaway, the conglomerate led by Warren Buffett, owns dozens of stocks in its portfolio. After the banking turbulence earlier in 2023, Buffett and his team decided to get rid of some of its bank stocks, and it's easy to understand why. But Berkshire kept a few, and some of them are trading for extremely attractive valuations.

A fintech with a focus on auto lending

Ally Financial (ALLY -1.38%) isn't exactly a household name, but it is one of the more impressive up-and-coming online banks in the United States. If you aren't familiar, Ally is the former financial arm of General Motors, so it shouldn't be too surprising that its main focus is auto lending. But in the years since it spun off, it has evolved into an impressive financial institution, complete with online checking accounts, high-yield savings, brokerage accounts, credit cards, and other types of consumer loans.

As of this writing, Ally trades for a 22% discount to its book value and for about 9 times forward earnings despite solid results from its business. In the third quarter, Ally's auto loan applications hit an all-time high, and $10.6 billion in new loans were originated with an average yield of 10.7%.

The company has $153 billion in total deposits, up $7.1 billion year over year due to its attractive high-yield deposit accounts. More than 1 million customers use Ally for deposits or investments. And finally, while Ally's delinquency rate has risen a bit in recent quarters, it is clearly starting to stabilize and is performing within the company's expectations.

An excellent bank with great margins

Capital One Financial (COF -0.58%) is best known for its credit card business, and for good reason. But it is also a rather large branch-based and online bank with a range of financial products and services. And right now, it trades 24% below its book value due to economic headwinds.

In the third quarter, Capital One's earnings grew by 7% year over year, and the business operated at a 51.9% efficiency ratio that would make most other branch-based banks jealous (most are in the 60s, and lower is better). Deposits and loans both increased 1% year over year despite the challenging environment, and credit card net charge-offs were up just one basis point sequentially.

Capital One is a very profitable business, mostly thanks to the relatively high interest rates of the credit card business. Its overall 6.69% net interest margin is one of the highest in the industry -- most of the big banks are in the 2%-3% range.

Well-run banks with short-term risks

To be fair, there are significant risk factors investors should be aware of with both of these. Both could see loan demand fall and default rates rise if the U.S. enters a bad recession or simply if interest rates stay elevated longer than expected. But these are two excellent banks with great margins, and both are well positioned to make it through the tough times and thrive when rates normalize.