LATER this decade the name "BankAmerica" may not be an exaggeration.The San Francisco-based bank could well have branches in nearly every state in the country, instead of in just nine Western states as at present. BankAmerica Corporation will have competition nationwide. Steven Felgren, a finance professor at Northeastern University here, forecasts that "in several years" there will be five to 10 "national banks" with branches in most states. By law, most commercial banks are confined with their deposit-taking branches to a single state or region. But legislation is moving through Congress that would end barriers to national banking. It could pass this fall, says Mr. Felgren. Major banks are gearing up for that possibility. BankAmerica and Security Pacific Corporation announced Aug. 12 a stock-swap merger worth nearly $4 billion. The combined bank, if approved by regulators, will be the second largest in the nation, with $190 billion in assets (after Citicorp, with $217 billion). Then BankAmerica, the surviving name, will operate in 10 Western states. Weeks earlier two other pairs of large banks announced mergers. Chemical Banking Corporation and Manufacturers Hanover Corporation, with assets totaling $135 billion, agreed last month to combine. NCNB Corporation and C&S-Sovran Corporation, with assets totaling $118 billion, also decided to merge. "The number of banks should shrink," says Gary Gorton, a professor of finance at the Wharton School in Philadelphia. "There are too many banks chasing after too few good loans." "We are going to see a lot of mergers in the next few years," agrees Allan Meltzer, an economist at Carnegie-Mellon University in Pittsburgh. The nation has some 12,000 commercial banks, vastly more than other industrial nations. John Ballantyne, a banking professor at Babson College, in Wellesley, Mass., guesses that the number of banks might drop to 9,000 in several years. Another expert has suggested 7,000 independent banks within five years. One reason for consolidation is that banks have lost an enormous amount of market share in the financing business. They now provide around 25 percent to 30 percent of the nation's credit needs compared with 80 to 90 percent a few decades ago, notes Dr. Meltzer. Financially sound major corporations now raise most of the money they require more cheaply through commercial paper. Banks, which at one time could obtain funds at an interest rate about one-quarter of 1 percentage point less than their best customers, now must pay the same amount more in interest. They cannot compete when companies decide to sell commercial paper (unsecured promissory notes) to the public. Interest rate deregulation in 1980 boosted the average cost of money for banks - to the advantage of depositors. Other institutions have taken away chunks of bank business in auto loans, credit cards, and mortgages. AT&T, for instance, has drawn away many bank customers with its Universal Card. Investment bankers, at least for much of the 1980s, did well selling junk bonds for corporations. Some banks, desperately seeking investments for the money entrusted with them as deposits, placed large sums of money in developing countries in the 1970s and in real estate in the 1980s. As a result of such risks, more banks have been failing. Until 1985, bank closures numbered less than 50 a year. Last year 169 banks failed; the Federal Deposit Insurance Corporation has projected 230 failures this year, though the failure rate has actually been less than that so far. Further, banks have had an average return on their capital that is well under the national average for all industries, according to Keefe, Bruyette & Woods Inc., a bank stock specialist. Some large banks, such as BankAmerica and New York City's so-called money-center banks, are merging with the dual purpose of reducing costs and positioning themselves for national banking. BankAmerica says it will save $1 billion a year after merging with Security Pacific. Many medium-sized or smaller banks are combining primarily to become more efficient. "It is a strategy of survival," says Professor Ballantyne. A merged bank can sometimes eliminate redundant branches, join expensive back-office operations, reduce staff, merge automatic teller machine (ATM) systems, and make other savings. But if a bank acquires a failing bank in a different state, the merger may not reduce excess banking capacity. Such a merger involves one-time costs of integration and standardizing banking products, and can add to the pressures on competitor banks. Bank regulators are reluctant to simply close a failing bank, preferring to have a healthier bank take it over. Mr. Gorton suggests that the government should encourage banks with poor profitability to close by giving their shareholders tax advantages if they shut them down. Despite the expected decline in bank numbers, the number of branches overall may not shrink proportionally as much, experts say. Because customers usually choose a bank on the basis of convenience, most banks will want to maintain numerous neighborhoods branches and large networks of ATMs.