Private equity funds are fronting cash to the smaller and midsized companies they had bought out, in an effort to help keep them afloat through the pandemic.

In the third quarter, midsized corporations that had combined debt of at least $7.6 billion received cash infusions, according to Lincoln International, an advisory firm that tracks a set of U.S. companies with less than $100 million in annual earnings. Last year, these sorts of transactions were rare.

The cash injections represent an unusual move for private equity funds that usually prefer to take money out of the companies they buy, and signal that the investment firms expect the current pain to soon pass for companies that do everything from running restaurants to building software. Buyout fund managers would rather keep their corporations afloat for a few more months than face messy bankruptcies. They expect to be able to take dividends out of their investments again, or sell the companies, once clouds part.

The cash infusions are coming mainly for smaller and mid-sized companies that have been bought out, where a relatively modest amount of money can keep the company afloat and ensure that lenders don’t end up taking it over. Among the firms that have received money are Stack Sports, a provider of software for athletic leagues that is backed by Genstar Capital, and First Watch Restaurants, a chain of breakfast and lunch eateries that’s backed by Advent International, according to people with knowledge of the matter.

This money has helped the $850 billion market for private credit perform better than many had feared this year, and has supported a range of players including lenders known as business development companies. An index of private debt shows that defaults fell to 4.2 percent in the third quarter, from 8.1% in the second, according to law firm Proskauer.

“Private equity firms mobilized very quickly to shore up their portfolio companies, either by providing liquidity or seeking flexibility from lenders even if it wasn’t immediately necessary,” said Suhail Shaikh, head of U.S. direct lending at Alcentra, a private debt manager overseeing more than $41 billion of assets.

It’s still an open question as to whether private equity funds’ cash infusions will be enough. Covid-19 cases are ramping up in the U.S., and it’s not clear how long it will take to get enough people vaccinated for the economy to return to normal. Until then, more companies may struggle, potentially cutting into returns for some private equity funds.

“Some of the borrowers have performed a lot better than the worst projections, but I think if there’s another leg down, that’s where you may see some trouble,” said Michael Ewald, global head of Bain Capital Credit’s private credit group.

And there is certainly pain for some lenders and companies. According to Keefe, Bruyette & Woods analysts, BDCs experienced a loss rate of 4.5% on their loan portfolios this year, with a loss in the first quarter followed by slight gains over the last two quarters, suggesting the worst may be over.

Even with this year’s difficulty, it was worse during the financial crisis when losses were more than 25%, the KBW analysts said. And it hasn’t been as bad as the firm had expected: In the first quarter, it estimated loss rates would be closer to about 7% for this downturn.

One step that private lenders have taken to reduce their losses has been to focus on companies at the larger end of the “small to mid-sized” spectrum, because these borrowers may have more resources to weather a tough economy. Ares Capital Corp., the largest middle-market lender classified as a BDC, has seen the average annual earnings before interest, taxes, depreciation and amortization of the companies it lends to increase to $85.5 million. That’s up from $66.9 million four years ago. The largest BDC under the Owl Rock Capital Partners umbrella lends to companies with on average $95 million in annual Ebitda.

“The types of businesses the industry is financing are bigger, more resilient and there’s great motivation to the sponsors to step in and support them,” said Craig Packer, co-founder of $23.7 billion direct lender Owl Rock.

Private equity funds have offered more than cash — they’ve also offered advice to companies about how to navigate the downturn, said Bain Capital Credit’s Ewald.

“Sponsors went right to management teams and said ‘we have to cut costs,’” Ewald said, adding that the firms told companies to look at steps like reducing capital expenditure and drawing down revolvers to boost liquidity. “That went down in a matter of weeks, not months or years.”

In exchange, lenders often were able to retool credit agreements to put them in a better position. For example, in situations where a borrower has needed relief, Owl Rock asked for some compensation like a higher interest rate, a fee or additional protection against the borrower buying back debt, as long as private equity funds are writing a check, Packer said.

“There’s no cookie cutter answer for every company, but we usually try to provide about a year of runway,” he said.