By David Benoit

Big banks expect the coronavirus recession to cut a wide swath through corporate America.

When they reported second-quarter earnings this past week, big U.S. lenders said they don't expect the U.S. economy to pull out of its slump soon. A protracted downturn, bank executives said, bodes poorly for all manner of American businesses, even those not directly affected by the travel bans and social-distancing measures put in place to curb the virus.

From the first quarter to the second, the four biggest American banks nearly doubled the amount of money they set aside to cover soured corporate loans. It was different in the first quarter, when banks increased provisions for consumer loans far more.

Even what looked like good news wasn't really. Investment-banking revenue soared in the second quarter. But the gains didn't come from advising CEOs on deals; rather, banks raked in fees helping companies stockpile cash to ride out the downturn.

"Everybody is, bluntly, struggling," Bill Demchak, chief executive officer of PNC Financial Services Group Inc., said on an earnings call Wednesday. "The generic corporate client we talk to, who's otherwise open and doing business, is almost without exception down from what they would have expected going into the year and down from where they were last year."

Banks have unrivaled visibility into the health of the U.S. consumers and businesses. They guard deposits, engineer mergers and lend money. They see how much is going into customer accounts, how much is going out and where money is being spent.

In the second quarter, they saw some alarming things. One by one, bank executives warned that the worst of the coronavirus recession has yet to come. They said they no longer expect a quick snapback in economic activity or employment.

"I don't think anybody should leave any bank earnings call this quarter simply feeling like the worst is absolutely behind us and it's a rosy path ahead," Citigroup Inc. Chief Executive Michael Corbat told analysts Tuesday. "I don't want to be pessimistic...I want to be a realist."

The four biggest American banks -- JPMorgan Chase & Co., Citigroup, Bank of America Corp. and Wells Fargo & Co. -- set aside $33 billion in the second quarter to cover loans that could go bad. Corporate lending accounted for $16.8 billion of it, up from $8.8 billion in the first quarter. (Bank of America set aside less for loan losses than the other banks. Chief Executive Brian Moynihan said early signs of a rebound are encouraging.)

JPMorgan, the biggest U.S. bank by assets, set aside $4.6 billion for commercial loan losses, up from $2.4 billion in the first quarter. It kept its consumer provision flat at $4.4 billion.

"In the first quarter, when we were really looking at a deep but short-lived downturn, we were really very much focused on most impacted sectors," said JPMorgan Chief Financial Officer Jennifer Piepszak. "Now that we're looking at a more protracted downturn, we're reserved for a much more broad-based impact across sectors."

Clients are hunkering down too. Even after the economy showed some signs of improvement, bankers said, companies were deep in emergency-preparation mode and loading up on cash.

When America shut down in March to beat back the coronavirus, companies stockpiled cash by drawing down their credit lines. In the months that followed, bankers said, companies paid back that debt and replaced it with new loans, bonds or convertible-stock offerings. JPMorgan, Morgan Stanley and Goldman Sachs Group Inc. all notched some of their best investment-banking quarters on record thanks to those offerings.

"People are scared, and they are responding by both banking their cash and basically prefunding their borrowing needs as much as they can," Wells Fargo bank analyst Mike Mayo said.

Some companies sold debt or equity more than once. Delta Air Lines Inc., a company deeply damaged by the pandemic, was among the bond market's repeat customers in the second quarter. Companies more insulated from the crisis, including Netflix Inc. and Slack Technologies Inc., raised funds too.

"The conversations are now about sustainability," said Tyler Dickson, co-head of banking, capital markets and advisory at Citigroup. "What can I do to survive this and, even more importantly, when I see the other side am I a winner?"

In good times, all that borrowing would be expected to spur investment and expansion. But businesses are parking it in their bank accounts. The U.S. banking system has added $2.2 trillion in deposits so far this year, triple any other six-month period on record, according to Federal Reserve data.

"We cannot forecast the future," JPMorgan CEO James Dimon told analysts. "We don't know. The word unprecedented is rarely used properly. This time it's being used properly."

--Orla McCaffrey contributed to this article.

Write to David Benoit at david.benoit@wsj.com

Corrections & Amplifications In the second quarter, Bank of America Corp. made a total of $1.06 billion in debt underwriting fees and $740 million for equity underwriting. In an earlier version of this article, the charts included only the fees made by the investment-banking unit for the five quarters presented. (Corrected on July 18)