During the 1980s an onslaught of competition and wild economic swings hit U.S. commercial banks so hard that today the banking system is both scarred and facing an uncertain future.

As changes swept through the banking industry, often sparked by rapid advances in telecommunications and computer technology, many institutions made a vain effort to hold on to fading markets and profits by taking steadily greater risks. Some of them paid a high price.

More than 1,000 banks have failed in the past 10 years and hundreds more are sure to do so in the next few years. The failures that have already occurred are expected to cost the federal Bank Insurance Fund $23.4 billion.

These are commercial banks, not the savings and loan associations whose losses now appear likely to cost taxpayers as much as $130 billion. Without the banks -- which daily handle the bulk of the nation's millions of financial transactions at their more than 60,000 banking offices -- a modern economy could not operate.

Now, however, the system as a whole may be stabilizing, according to a number of analysts who believe that only one sizable bank, the $25 billion Bank of New England, is in such bad shape that it might fail in the near future. Last year 11.4 percent of all banks lost money, but that was down from a high of 20.6 percent in 1986.

Meanwhile, as the institutions in the most trouble have been closed or merged out of existence and other banks have overcome their losses, the number of institutions identified as problem banks by federal regulators has shrunk from a peak of 1,559 at the end of 1987 to 1,093 at the end of last year.

But stabilizing a weakened system is not the same thing as making it healthy again, and its future remains uncertain, partly because the future of the economy is uncertain. The banks, urged on by federal regulators, have begun to try to limit future losses by tightening up their standards for making loans.

During the '80s, the nation's biggest banks often took the greatest risks and their profitability has suffered the most. One of them, Continental Illinois National Bank and Trust Co., effectively went broke, although it is still doing business with the federal government as its largest shareholder. During the decade, the top 10 U.S. banks wrote off as uncollectable nearly $40 billion worth of bad loans while earning less than $30 billion.

"The heart of the question is, is banking a business you can still make money in?" L. William Seidman, chairman of the Federal Deposit Insurance Corp., which manages the Bank Insurance Fund, said in an interview. "The answer is clearly, yes.

"But are the risks too high for the return they are making? I can't provide an answer I have a lot of faith in. I do think that as banks get into higher risks they have to have more capital" to cushion losses, Seidman said.

By no means are all banks in a weakened condition, and some of them, such as the Bank of America, the third-largest U.S. bank with nearly $100 billion in assets, have had impressive turnarounds. Bank of America made more than $1 billion last year after losses on loans to developing nations and a series of management mistakes had put the institution on the ropes.

Some large regional banks, such as BancOne in Columbus, Ohio, and PNC Financial Corp. of Pittsburgh, are praised by bank securities analysts for their strong competitive position and profitability. And among the 12,700 commercial banks, many smaller ones are well capitalized, competitive and highly profitable.

Still, waves of losses repeatedly have hit the industry, involving lending to farmers, energy companies, developing nations, real estate developers and, perhaps soon, loans to finance corporate takeovers and other so-called highly leveraged transactions. Currently the greatest worry among bank regulators is the weakening real estate market in the Northeast, which has put the Bank of New England into a fight for its life.

Moreover, some analysts say that a recession could bankrupt enough business and individual borrowers that their inability to repay their loans could cause a crisis for many banks that don't have enough capital to cover such losses.

In such a situation, of course, the Federal Reserve, the nation's central bank, would be forced to provide huge amounts of cash to prevent collapse of the system and potentially enormous damage to the U.S. economy.

Concern about the health of the banking system, however, did not keep the Federal Reserve from raising interest rates in 1988 to slow the economy to fight inflation.

Nevertheless, fragility of the system is one reason Federal Reserve policy makers have no intention of bringing on a recession to achieve their goal of cutting inflation to negligible levels, according to senior Fed officials.

Robert Dugger, chief economist for the American Bankers Association, said the single most helpful thing government could do to assist the banking industry would be to reach a compromise on taxes and spending issues that would lower the federal budget deficit and bring down interest rates.

Another part of the uncertainty about banks is political. A major clash could develop later this year between banks and their competitors, on the one hand, and between the Bush administration and congressional Democrats, on the other, after the Treasury Department issues a report on whether to make changes in the federal deposit insurance program.

Kenneth A. Guenther of the Independent Bankers Association described 1990 as a lull before the storm, "a transitional year looking to cataclysmic banking legislation in 1991."

The existence of deposit insurance, plus an implicit policy among regulators that very large banks cannot be allowed to fail because of the threat such an event would pose to the safety of the entire banking system, has meant that bankers could pursue very risky business strategies without having to worry that their depositors and other investors would withdraw their money.

This federal "safety net," which also includes the right of banks to borrow cash from the Federal Reserve when they need it, has protected depositors and the banking system. But it has also created what analysts call a "moral hazard." With the safety net in place, managers of some troubled banks have taken on larger and larger risks in hopes of a big payoff that will stave off bankruptcy. In effect, they have rolled the dice using taxpayer money to place their bet.

The future of deposit insurance is also intertwined with the long-running debate between banks and their competitors over reducing restrictions on the types of business banks can do, such as a prohibition on handling new issues of corporate stock. Banks have been pressing for more freedom for years as part of an effort to bolster their sagging profits.

The Treasury is expected to make recommendations about these restraints late this year. Some officials, such as Fed Chairman Alan Greenspan, fear that relaxation of the current restrictions, which he generally favors, would increase taxpayer exposure to future losses by extending the federal banking safety net to non-banking activities, such as securities underwriting and insurance.

E. Gerald Corrigan, president of president of the New York Federal Reserve Bankthe New York Federal Reserve Bank, who shares Greenspan's concern about extending the safety net, nevertheless has called for reform of the restrictions on banks.

"The U.S. banking system is simply out of step with the rest of the world and, more importantly, it is out of step with the realities of the marketplace. Even more importantly, the system as now configured may be risk and accident prone, rather than risk averse," he declared in congressional testimony earlier this month.

In fact, during the past decade, many restrictions on banks were eased, including those at the state level that kept a bank in one state from owning a bank in another state. Often the laws limited competition geographically within a state as well. Today, all but three states, Montana, North Dakota and Kansas, allow outside banks to own banks within their borders.

Last month, Thomas G. Labrecque, president of Chase Manhattan Corp., the holding company that owns the nation's second-largest bank, argued that banks need greater freedom. "Banks have already lost large segments of their traditional markets to other financial-service providers in the United States... . Ford, Prudential, Merrill Lynch, American Express and others are permitted to offer an essentially complete array of financial services. U.S. banks are not.

"As a consequence," he said, "U.S. banks have lost market share in the core business of banking, leaving them less efficient, more risky and ultimately less capable of servicing the needs of our customers and the nation's economy."

Foreign banks, some of which can raise capital in their home countries more cheaply than U.S. banks can here, are steadily taking business away from American banks. In terms of size, the largest U.S. bank, Citibank, which has $230 billion in assets, barely makes the top 25 worldwide.

Corrigan of the New York Fed said that there are simply too many banks and other firms offering financial services.

"We now have, in my view, excess capacity in large segments of banking and finance," he told Congress earlier this month. "The same condition appears to exist internationally... . The symptoms of this condition abound in razor-thin spreads, pinched margins and, perhaps especially, in the troublesome manner in which we see vast amounts of very short-term churning and trading in so many segments of the financial markets."

These realities "clearly imply that we will have to go through a period of at least some consolidation in banking and finance," Corrigan concluded.

In a sense that is what has been going on as banks have failed or were merged out of existence. The process is far from over. Last week the FDIC's Seidman predicted that another 150 to 175 banks will go under this year.