In early July when Mobil Corp. borrowed $6 billion from an international syndicate of banks to finance its attempted takeover of another large oil company, Conoco, it had to pay about 19 percent for its money.

At about the same time, when major banks across the country were quoting a prime lending rate of 20 1/2 percent, an Alexandria service station operator got a loan at 18 percent.

Meanwhile, a Montgomery County builder drew down $50,000 of his established line of credit at the Sandy Spring National Bank and Savings Institution. The credit line called for an interest rate of prime plus 2 1/2 percentage points, or 23 percent at that point in July.

But the builder, at work on an office building, was an unusually good customer of the bank and consistently had a large balance in his checking account there. Keeping those facts in mind, officials at the Sandy Spring bank took a close look at their cost of funds--the interest rates they were paying for money on deposit--and decided they would charge the builder prime, 20 1/2 percent, instead of 23 percent.

At 20 1/2 percent, the builder's loan was hardly cheap. However, in an era of expensive money and floating rate loans, 2 1/2 percentage points still matter. And to the area's business borrowers, the most important point is that the banks do have money to lend, although a few are not looking for any new customers at the moment.

Even when rates are low, bankers and other lenders turn down some loan applications because they don't believe the borrower can repay. The problem is much more serious with high rates, with many borrowers themselves fearing they can't repay. For some borrowers willing to take the chance, the bankers are not.

The key to that builder's getting a loan and getting it at a lower rate was his total relationship at the bank, a major factor in the way banks throughout the Washington metropolitan area price their loans.

For instance, Robert P. Pincus, manager of the commercial banking division of the District of Columbia National Bank, says about 15 percent of the bank's loans are made at prime and the rest at 1 or 2 percentage points over. The exact rate is set after a "subjective" evaluation that depends about 60 percent on the customer's relationship with the bank, about 20 percent on risk and 20 percent on the type of loan, Pincus explains.

An institution with about 80 percent of its $125 million in deposits coming from 4,500 commercial accounts and about 80 percent of its $97 million loan portfolio made up of credit extended to about 900 businesses, D.C. National was not charging any of its customers more than 20 1/2 percent back in July, says Thomas Condit, the president. D.C. National pegs its prime to the rate published by Citibank, the nation's second largest commercial bank, but beginning in April, 1980, it capped its own prime at 18 percent.

"The percentage of interest-sensitive money at our bank is significantly lower than at Citibank or any money center bank," Condit says. Thus, as a competitive move, the rapidly expanding D.C. National decided it could afford to hold its prime at 18 percent, while keeping it in line with the Citibank prime whenever that rate fell below 18 percent.

D.C. National's customers loved it, according to Condit, but it proved too good to last. The cap was lifted in late August when it became clear the bank's earnings were suffering. "What has happened to us and to other banks our size," Condit says, "is that we have taken a terrible beating from the money market funds."

Over in Alexandria, Condit's words are echoed by C. S. Taylor Burke Jr., president of the Burke & Herbert Bank and Trust Co. Because of the money market mutual funds "so many of our customers have taken their money out of the bank," Burke says, "we are about 75 percent loaned, which is a no-no. The bank examiners would like to see us at 65 percent.

"We are creating no new lines of credit and we have passed up some excellent business, some chances to steal some business from larger banks," Burke continues. "Instead, we are asking some customers voluntarily to reduce their credit lines for the next few months."

At the same time, the bank, which grew by about 25 percent in 1980, has stopped bidding for costly $100,000 certificates of deposit in order to let them run off to improve its ratio of capital to total resources.

This problem with the money market mutual funds, which has raised both the banks' marginal cost of funds and their average cost, is by no means confined to smaller banks. Riggs National Bank, the area's largest and the 50th largest in the country with $2.9 billion in deposits, lost nearly $100 million in checking account deposits in the year ended June 30.

William G. Tull, an executive vice president at Riggs, says the drop in demand deposits, on which the bank pays no interest while incurring costs servicing them, is the result of growth of the money funds and of depositors moving their cash into various types of certificates of deposit. While demand deposits were falling by nearly $100 million, the bank's time deposits in domestic offices were going up by almost $230 million.

Other large banks in the area, such as Suburban Trust Co. in Maryland and United Virginia Bank, have had similar experiences. In every case, the banks' cost of funds has gone up as depositors seek a higher return on their money. The cost of borrowing by business has gone up as a consequence.

The financial squeeze has not caused any wave of business bankruptcies in the Washington area, and banks have not seen any significant jump in delinquencies in meeting payments on commercial loans.

Surprisingly, says Preston Holmes, executive vice president for credit administration at United Virginia Bank, which has numerous offices in Northern Virginia, "In the consumer and commercial fields, delinquencies are better than they were a year ago. That's an unusual thing given the credit conditions."

Holmes is worried about what will happen to business borrowers if the level of interest rates does not fall significantly and soon. "The question is, how long can people hold out while continuing to pay their debts in a high-interest rate environment? All the danger signs are there," he warns.

The most remarkable thing in this area is that many commercial banks are far more heavily involved with financing real estate than banks usually are, and still they are not having great difficulty with their loans.

At Suburban Trust Co., for example, about 50 percent of the loan portfolio involves real estate. "In the suburban areas, the main industry is real estate," says Warren Rothe, executive vice president of Suburban Trust. "The problem is not with the builders but that people just don't qualify for mortgages at these rates.

"We've had some smaller builders that have had their problems," Rothe says, but the bank is not rushing to foreclose. The builders are not really bankrupt, only illiquid, since they can't sell the homes they are building or have already finished because of the lack of mortgage money, he adds. Foreclosing is not much of an answer, Rothe observes. "If he can't sell it, we can't sell it."

United Virginia, on the other hand, has a loan portfolio of $2.6 billion with about half of it in commercial loans. About 10 percent of that half, or roughly $125 million, has been lent to businesses with a net worth of less than $250,000 that qualify for the bank's so-called small business prime. That rate is simply 1 percentage point lower than the bank's prime, so that if the loan otherwise would have been made, say, at prime plus two, the actual rate would be prime plus one, Holmes explains.

Holmes says that United Virginia, whose basic prime closely follows that of New York banks, provides a "rate guide" to its loan officers based on its cost of funds and other factors. Regional loan committees, which can approve loans up to $5 million without any okay from the Richmond headquarters, can vary rates in the guide by up to 1 percentage point. If for some reason a regional committee wants to deviate from the guide by more than that, it must get approval from Holmes or United Virginia president D. H. Ludeman.

United Virginia, like all other banks in the area, makes virtually nothing but floating-rate loans, or else writes notes that mature within such a short period--up to 90 days usually--that any risk to the bank from a rapid increase in their cost of funds is minimized.

Daniel J. Callahan III, president of Riggs National Bank, says that the interest rate charged major borrowers usually changes the same day Riggs changes its prime. "There are no 90-day notes on $10-million loans," he says. For smaller lines of credit, the rates change less frequently once a note is drawn.

Riggs, as a major bank deeply involved in national money markets, does make loans to major borrowers at rates below prime, Callahan says. Such loans, which are concluded in a highly competitive marketplace peopled only by the very large national and regional banks, are made to business borrowers who are themselves so large and whose credit ratings are so good that they have access to other sources of credit, including foreign banks and the commercial paper market. (Commercial paper consists of promissory notes issued by corporations and sold to investors, such as other corporations, either directly or through brokers without involvement by a bank or other financial intermediary.)

The pricing of such a loan is usually based on the cost to the bank of obtaining funds through large negotiable certificates of deposit adjusted for the fact that the bank must set aside 3 percent of each CD as a reserve on which the bank earns no interest. Riggs then adds about a 1 1/2 percentage point spread. Currently, such a loan might carry about a 17 percent interest rate compared with Riggs' prime of 18 percent.

"Who can command that type of rate? A corporation with close to triple-A credit who probably has the ability to borrow from several sources," Callahan says. In addition, the loan must be for a very short time, perhaps even just overnight.

Ironically, with such loans, which smaller banks never make, the whole emphasis on long-term relationships is reversed. These borrowers have long since started managing their money in such a way as to minimize idle balances. They have no large checking account balances drawing no interest overnight; that money is parked in some interest-paying investment.

But there are few companies in the Washington area with access to other markets and other sources of credit. Most business borrowers here must deal with a bank, except perhaps for construction loans for large real estate projects or for permanent mortgages when the projects are finished. So that long-term relationship counts.

At the Sandy Spring National Bank and Savings Institution, which has branches in Olney and Colesville as well as Sandy Spring, President Willard H. Derrick and Vice President Jerome B. Schaufenbuel stress the personal nature of the service they give their customers. "I think we have a basic philosophy here to look out for our customers. We are not out to gouge them," Derrick declares.

The Sandy Spring bank follows the lead of the First National Bank of Maryland, its principal correspondent bank, in setting its prime. "Sure we have a prime," Derrick says, "but we like to think it's in moderation to what it might be. We have modified it sometimes when we think it is artificially high compared to our cost of funds"--as the local builder mentioned earlier discovered.

Whether the bank is large or small, the same forces shape the amount and cost of credit to commercial borrowers. In downtown Washington at Riggs, and in northern Montgomery County at Sandy Spring, the bankers are looking at average balances in accounts, the cost of servicing the accounts, the type of loan involved, the risk, the collateral, the cost of funds to the banks and so forth.

There is a lot of human judgment involved," says Schaufenbuel at Sandy Spring. "A larger bank has more rigid policies. We can look at every loan and treat the borrower well."

In another sign of the times, Schaufenbuel says he is spending more and more time as a financial counselor to the bank's business customers helping them cope with the world of high interest costs, and in some cases discouraging overly ambitious plans for expansion.

Burke & Herbert, with $86 million in deposits on Sept. 30, is a bit bigger than Sandy Spring, but it, too, prides itself on personal service, knowledge of its customers and a desire to help them weather a bout of tight money. And it has one policy that may be unique to the Washington area: It lends to all of its commercial borrowers at essentially one rate.

The bank has a wide variety of commercial borrowers, the president, Taylor Burke, notes. It can lend up to about $1 million to any one borrower, but only a couple, a lumber company and a building and leasing company, have credit lines that large. But borrowers large and small get their money at prime, period, Burke says.

"How can I tell a customer he is not a 'prime' customer?" Burke asks. "If he's not a prime customer, we don't want to lend at all. We don't have a spread of more than 1 percent between a triple-A customer and an 'A' customer. If he has $100,000 in a checking account, we will make some concessions, but we don't charge over our prime unless there are extraordinary circumstances."

At the larger banks, such as Riggs, Suburban Trust and United Virginia, officials maintain they can provide service to smaller business borrowers just as well as can the smaller banks. For instance, Callahan at Riggs says his bank is now analyzing corporate accounts in great detail, at the request of the corporations, to help them pin down the cost of banking services and get more information about their financial condition. "We are doing things in our industry that no other business is doing," Callahan says.

(Officials at another large Washington bank, American Security Bank, declined to be interviewed for this article.)

Every banker, whatever the size of his bank, says he would make more money if interest rates were lower. And every one is having to cope with not only high interest rates but also a rapidly changing financial marketplace in which some of the competition, such as money market funds, were hardly a factor just two years ago.

Bankers, as they cheerfully acknowledge, live on the spread between the cost of money they acquire and the rates they charge the people and businesses who borrow it. Their response to the new realities in financial markets has been to try to shift as much risk as possible to borrowers through floating rates and, in some cases, to scrutinize loan applications more closely.

Most business borrowers have no recourse but to accept these changes. After all, they have no ready alternative source of credit, whatever its cost.