In the first quarter of the year, Warren Buffett and his company Berkshire Hathaway (BRK.A -0.28%) (BRK.B -0.68%) bought close to 9 million shares -- a roughly 2.9% stake -- in the large digital bank Ally Financial (ALLY 0.13%), which specializes in auto lending. With inventory still being challenged and used car prices soaring, Ally has flourished, generating strong financial results since the pandemic started.

But given its cheap valuation, the market clearly isn't buying the sustainability of Ally's earnings. Buffett and the market are clearly at odds here. Who will be right?

A strong auto market has led to strong results

When the pandemic initially hit in 2020 and broad swaths of the economy closed for months at a time, the roads really cleared as people stayed home. Due to this lack of demand to travel, many automakers slowed their production. But as the economy normalized and people began hitting the roads again, the industry ran into supply chain issues -- particularly around semiconductor chips -- that have persisted and kept inventory low. This has led to elevated car prices across the board, particularly among used vehicles, which have increased roughly 60% compared to 2019.

A picture of Warren Buffett.

Image source: Motley Fool.

This dynamic has been good for Ally's auto business. At the end of the second quarter, Ally had more than $82 billion of retail auto loans, up $9.5 billion since the second quarter of 2019 and $6.4 billion year over year. Meanwhile, the average portfolio yield on these retail loans is 6.85%, up 10 basis points (0.10%) from the year's first quarter. This helped Ally deliver a 23.2% core return on tangible common equity in the second quarter.

And the strength has apparently continued into the third quarter, according to Ally's CFO, Jenn LaClair, who said pricing has continued to increase. Origination yields on retail auto loans in Q2 came in at 7.82%, up 75 basis points from the first quarter. LaClair said the bank is now originating retail auto loans at 8% while maintaining its underwriting criteria.

LaClair said the company still believes there are a good 4 million to 5 million customers not participating in the auto market because of the inventory shortage. She added that application flow has remained solid and the company isn't seeing much price sensitivity, particularly among more affluent customers.

We do see really strong application flow in the higher-income earners, which we have defined as kind of over $50,000. And our average in terms of income of our customers that we are originating with is over $100,000. So in that segment, with the supply constraints and with our model, we really don't see this slowing down.

Looming challenges for Ally

Despite great results and strong near-term demand, investors and analysts are dreading the time when conditions normalize to pre-pandemic levels, which could lead to credit issues, especially considering how large some of the loans are due to higher auto prices.

During the second quarter, Ally saw its 30-plus-day delinquency rate jump from 2.02% to 2.52%. This rate is still below pre-COVID-19 levels and the result of typical seasonality in Q2. But despite management's assurance that current credit trends align with expectations, investors are nervous nonetheless. Management clearly knows the industry and does expect used car prices to come down. In their assumptions, Ally is modeling for a 30% reduction in used car prices from the end of 2021 to 2023.

Due to the Federal Reserve's sharp increase in interest rates in recent months, another issue analysts are worried about is funding costs. Over the years, Ally has actually done a great job of improving its core deposit base. In 2018, just 64% of its funding base was composed of deposits. At the end of the second quarter of this year, that number had jumped to 85%. But with a total yield of 1.16% on its total funding base, Ally's funding is still far less sticky and more expensive than many other large banks, which will inevitably lead to higher deposit costs in the near future, given the Fed's aggressive hikes.

Why Buffett is making this bet

Considering Berkshire's stake amounts to only 0.1% of its large portfolio, I think Buffett does understand that there are risks involved with this bank. But this is likely a bet the Oracle of Omaha and Berkshire view as favorable in terms of the risk-reward proposition, considering Ally's cheap valuation. The stock trades at five times forward earnings and about 90% of its tangible book value, or net worth.

Ally's management team has acknowledged the challenges, modeled a significant decline in used car prices, and still thinks they can generate a sustainable 16% to 18% or higher return on tangible common equity in the medium term. If they achieve this through more difficult economic conditions, the stock will certainly trade higher.

Furthermore, Ally has a strong track record of repurchasing a lot of stock and, at its current share price, has an annual dividend yield of 3.4%, two other things Buffett and Berkshire love.