If you include stocks that trade on foreign exchanges, as well as situations where more than one class of the same stock is owned, Berkshire Hathaway owns 54 stocks in its portfolio, as of the latest information. To be fair, there's a strong investment case to be made for quite a few of them, even after the recent stock market rally.

Berkshire's CEO Warren Buffett -- who is responsible for most of the stock portfolio -- is a big fan of banking as a business. Therefore, it shouldn't be much of a surprise that the company owns five bank stocks in its portfolio. And while all five look like great long-term investments, Ally Financial (ALLY 0.41%) is the one I'm most excited about.

Ally Financial's excellent business model

Ally specializes in auto lending and high-yield deposit accounts. The bank offers other types of loans and banking products, as well, but this is where the bulk of its loan portfolio and customer base is concentrated.

Ally was spun off from General Motors (NYSE: GM) in the wake of the financial crisis -- hence, the auto-lending focus -- and 77% of its loan portfolio consists of auto loans and leases. It also offers corporate loans, mortgages, credit cards, and other loan types and has an online consumer banking platform that offers high-yield savings accounts, brokerage accounts, robo-advisory services, and more.

The economics of Ally's business are fantastic, and this is likely what attracted Buffett and his investing team. The average auto loan originated by Ally in the most recent quarter had a 10.4% interest rate. Meanwhile, the bank paid an average of 3.7% on its deposit base.

Even accounting for a reasonable number of loan defaults (more on that in a bit), this is a hefty margin. Ally reported a 3.38% net interest margin in the second quarter. For context, Buffett's favorite bank stock Bank of America reported 2.06% in the same period.

Not without risks

Of course, there are some major risk factors to keep in mind. The recent banking turmoil appears to have subsided, but there's no guarantee that the volatility in the industry won't come back, especially if a recession hits. It's worth noting that 92% of Ally's deposit base is FDIC-insured and concentrated in smaller, retail depositors. As a result, the bank should be somewhat insulated.

Most significantly, there are fears that a recession could cause Ally's loan losses to spike. And to be fair, consumers have been paying more for their cars than ever, so there are legitimate worries that spiking unemployment could make people unable to pay their bills.

While Ally's net charge-off rate of 1.32% in the second quarter was up significantly from 0.54% a year ago, it was actually down sequentially and is currently consistent with pre-pandemic norms. Plus, the bank has 3.62% of its retail auto-loan balances in reserves, so its business should be completely fine, even if charge-off rates were to double from here (which I view as unlikely).

The bottom line

Ally isn't exactly a low-risk bank stock, especially with most experts predicting a recession in the near future. We could certainly see default rates move higher and consumer demand fall if times get tough.

However, the bank has a highly profitable business model with plenty of wiggle room built in for losses, as well as a fantastic history of capital return through both buybacks and dividends. The stock yields 4.1% at the current price, and Ally has bought back nearly 30% of its outstanding shares over the past five years alone. With its shares trading for less than 8x forward earnings and about 22% less than book value, Ally could be an excellent long-term compounder for patient investors.