Many worry that Berkshire Hathaway (BRK.A -0.57%) (BRK.B -0.40%) is simply too big to outperform, even with one of the world's greatest investors calling the shots. But if it can continue to find special situations like that of Home Capital Group (HCG), Berkshire may be able to outperform the market for a very long time.

In a very special deal, Berkshire bought into the bank at a discount and sold at a premium, a move that only the Oracle of Omaha could make.

Getting paid for the Buffett name

The Home Capital Group story is an incredible one. In April 2017, a securities regulator accused the Canadian bank of making misleading statements about the quality of its mortgage underwriting, setting off alarm bells for investors and depositors alike.

By June, Home Capital Group was in crisis, as depositors were fleeing the bank. As much as the bank needed liquidity, it also needed credibility -- in a span of just a few short months, 95% of the bank's high-interest savings account deposits left it, according to Fortune.

Warren Buffett at a Berkshire Hathaway shareholders meeting.

Image source: The Motley Fool.

Insert Berkshire Hathaway, arguably one of the best bank investors of all time. The conglomerate gave Home Capital Group a loan shark-style deal, offering to lend it up to 2 billion Canadian dollars at a 9% interest rate, secured by more than CA$5 billion of mortgages. Berkshire Hathaway also took a near-20% stake in the bank, buying shares at CA$9.55, a 20% discount to the average price in the 20 days leading up to its final proposal. Upon shareholder approval, Berkshire could later increase its stake to more than 38% of the bank with an additional equity investment.

Buffett's first equity and debt investment was enough to inject confidence into the bank. Almost overnight, its liquidity position improved thanks to Buffett's cachet, and fears over its solvency dissipated. In a testament to how quickly things changed, Home Capital Group relied on Berkshire's credit line for less than one month, repaying it by the end of July 2017. Home Capital shareholders later voted not to allow Berkshire to buy even more of the bank at a discount.

Even though Berkshire would earn only a trivial amount in interest on the loan, it had already exacted a high "fee" in the form of deeply discounted Home Capital Group stock. In roughly one month, Berkshire saw a 53% gain on its Home Capital shares, partly due to the big discount at which it bought the stock and partly due to investors buying up shares on the back of Buffett's investment.

Buying at a discount, selling at a premium

Berkshire Hathaway often gets a good deal when buying into a bank on the brink, but rarely has one paid it handsomely to sell out -- until now. That's where this story diverges from that of many of Buffett's bank bailouts.

Last month, Home Capital Group announced it would buy back as much as 22.7% of its outstanding stock through a tender offer at a price of CA$16.50 to CA$18.50 per share, a 17% to 31% premium above where shares had most recently closed.

Shareholders could submit to sell some or all of their stock at a price in the range of CA$16.50 to CA$18.50. Berkshire Hathaway was happy to cash in, offering to sell the entirety of its stake back to Home Capital Group for CA$16.50 per share. The bank will buy back 83% of Berkshire's stock at that price.

So, to recap, Berkshire Hathaway bought Home Capital shares at a 20% discount to the market price in June 2017. This week, we learned that it will sell approximately 83% of its shares back to Home Capital in a tender offer at a price 17% above where shares traded prior to the tender offer.

Berkshire bought in at a discount to market price and is selling most of its stock at a premium to the market price, which is about as good as it gets.

Bailing out Buffett

Warren Buffett's Berkshire Hathaway may have bailed out Home Capital Group, but Home Capital Group also bailed out Berkshire Hathaway.

The tender offer to buy back stock allowed Berkshire to quietly cash out of 83% of its stake in one transaction, enabling it to sell down its position without driving down the market price. Prior to selling shares in the tender offer, Berkshire's position was equivalent to about 45 days of trading volume in Home Capital Group shares.

The tender offer was also advantageous for Home Capital Group, which, by buying back most of Buffett's stock, no longer has to worry about a trickle of headlines about Berkshire selling down its stake in sales through the open market. Now that Berkshire owns less than 10% of the bank, it can quietly sell the remainder of its shares with fewer disclosure requirements.

This deal was a great one for Buffett and Berkshire, though anyone who tried to duplicate the trade is left holding losses. Home Capital Group, which opened at CA$17.20 per share after Buffett bought in, now trades for less than CA$14 per share. The tender offer, which locked in big gains for Berkshire, would have only locked in losses for people who followed him into the trade.