A little more than a week ago, Berkshire Hathaway (BRK.A -0.39%) (BRK.B -0.21%) made news when it posted its 13F filing, which detailed the changes in the company's $300 billion stock portfolio in the second quarter. Investors are keen to know what moves the company, run by Warren Buffett, has made as a guide to help them make decisions in their own portfolio.

One of the biggest moves that Buffett made in the second quarter was adding to his position in Ally Financial (ALLY 0.91%), an online bank and lender. Let's take a look at this stock to see if it is one you should consider for your portfolio.

Buffett tripled Berkshire's stake in Ally

Buffett added Ally Financial to Berkshire's portfolio in the first quarter of this year, with a stake of about 9 million shares. In the second quarter, he more than tripled his stake in the company and now owns roughly 30 million shares valued at about $1 billion.

What does Buffett like so much about this bank? Ally Financial is an online bank that is the largest automobile lender in the nation. In a previous life, it was called General Motors Acceptance Corp. (GMAC), the auto financing arm of General Motors, before it spun off in 2010 as a full-service online bank and lender. As of June 30, it was the 22nd largest bank in the U.S., with about $175 billion in assets under management.

A key reason for the increased interest is likely Ally's low valuation. The stock is ridiculously cheap right now, with a forward price-to-earnings (P/E) ratio of 4.5 and a price-to-book (P/B) ratio of 0.91. The forward P/E means it is trading at just over 4 times its earnings, while the P/B ratio means it is trading below the value of its assets on the books -- or book value. These are both clear indicators of an undervalued stock.

Also, Buffett has made no secret about the fact that he likes bank stocks. While cyclical, they are typically sturdy businesses that you can rely on when the economy is growing. But there are a few things that stand out about Ally among banks.

One is its strength and leadership position in auto lending, which drives its revenue. In the second quarter, Ally had $13.3 billion in auto loan originations, its best quarter since 2006. Roughly 70% of that was from used car loan applications.

And this comes during a time when some 4 million to 5 million consumers are on the sidelines because of new car supply constraints, CFO Jenn LaClair said in the second-quarter earnings call. Overall, net financing revenue was up 13% in the quarter, year over year, to $1.76 billion.

The other competitive edge that Ally has is its efficiency. Because it is completely online, there are no brick-and-mortar branches, and there is less human capital, so it has significantly less overhead than other banks.

While there are more online banks now, Ally was among the first, and it has already built its name and established itself as a market leader in auto loans. Its adjusted efficiency rating -- which measures how much expense it takes to earn $1 of revenue -- is 43.9%, down from 44.5% a year ago. Most of its brick-and-mortar competitors are over 60%.

Is Ally Financial stock a good buy?

The reasons cited above are a big part of why I've been a fan of this stock. Another reason is that Ally also pays an excellent dividend. Ally pays out a $0.30 per share quarterly dividend that yields a robust 3.49%. Its payout ratio is a highly affordable 14%, which means it has plenty of capital and earnings to continue boosting that dividend in the future. Already, it has increased its annual dividend payout for seven straight years. 

Ally also has an aggressive share repurchase program, as it bought back $600 million in stock in the second quarter. Ally has already repurchased $1.2 billion in stock this year on its way to a planned $2 billion for all of 2022.

The stock price is down about 25.3% year to date, and continued volatility is expected the next few quarters as macroeconomic uncertainty continues. But Ally Financial should benefit long-term from rising interest rates and pent-up demand for new cars (and new car loans). At this low valuation, and given its strengths and efficiency, it is clear to see why Buffett is buying Ally stock.