What is it about an ATM fee that drives people nuts?

You pay an average of $1.50 to withdraw money from your account at a "foreign" automated teller machine (an ATM that isn't owned by your bank). And you begrudge every penny.

But the ATM owners provide a service that, to me, is worth paying for. They've made cash available any time, anywhere.

In the pre-ATM days, you generally couldn't cash a check at another bank. You had to use your own bank. At lunch time, the lines for the tellers could be a lunch hour long.

Today, there are some 200,000 ATMs in the country that anyone can use, compared with 83,000 banking institutions.

The number of ATMs soared after 1996, when surcharges were permitted in all states. You now find the machines in airports, malls, supermarkets, office buildings and other handy places. Some consumer groups think that ATMs should serve all comers, free. San Francisco and Santa Monica, Calif., both passed ordinances recently to prohibit banks from levying surcharges.

A federal judge has suspended enforcement while the bankers fight the ordinance in court. The banks can still levy surcharges. But if they do, the money must be escrowed while the court decides its fate.

In Santa Monica, Wells Fargo Bank and the Bank of America have closed their ATMs to people who aren't their own customers.

The two states that ban ATM charges, Iowa and Connecticut, are defending their laws in court. A judge in Connecticut recently ruled that state bans on ATM fees are illegal, because national banks come under federal jurisdiction. The Connecticut case is on appeal.

Jon Golinger of the California Public Interest Research Group in Sacramento says about 12 cities may jump on the ban-wagon. The Connecticut court decision, however, may give them pause.

Two things seem to anger customers most:

* You resent being charged--or, as some think, double-charged--to get your own money out of a "foreign" bank's ATM.

There are indeed two fees, but they're levied for different services. The fee shown on the ATM screen (say, $1.50) goes to the ATM owner, for dispensing cash to non-customers.

A second fee ($1 to $2) goes to the network that processes the transaction. Most networks are joint ventures among banks.

* You think the combined cost is too high. But ATMs don't appear to be big profit centers. According to the latest Federal Reserve data, big banks made an average of 7 cents per transaction last year ($2,142 per machine). The smaller banks lost 18 cents ($4,845 per machine).

Golinger thinks ATM fees reduce competition. Big banks with many ATMs might decide to run fees up. That might push small-bank customers into the arms of the big banks' ATMs, so they can use those ATMs free.

But small banks, in general, charge lower fees for all banking services than big banks do. So they're probably cheaper, even if you have to use foreign ATMs.

Economist Robert Litan of the Brookings Institution in Washington thinks that banning ATM surcharges at banks would be anti-consumer.

Banks could simply sell their ATMs to non-bank operators, who might charge more, Litan told my associate, Dori Perrucci. (The American Bankers Association commissioned Litan to study the subject.)

Some small banks are striking back by forming ATM alliances. Customers can use the ATM of any alliance member at no charge, while outsiders have to pay.

ATM use dropped almost 2 percent this year, as fees spread and customers rebelled. Here's how not to pay:

* Use only the ATMs owned by your bank. You still pay for the service, but not in the form of an overt fee. The cost is passed on to customers as part of the bank's general overhead. (There may be overt fees, however, if your balance falls below the minimum.)

Of ATM users, 40 percent go only to their own bank's machines, according to PSI Global in Tampa, a research and marketing firm.

* Find banks whose ATMs dispense cash to non-customers at no charge. There's a list for 11 cities at Bankrate.com.

* Avoid multiple charges, by visiting ATMs less and taking more money each time.

* When you travel within the United States, don't depend on ATMs for cash. Use traveler's checks, especially if your bank provides them free.

* Use the debit cards issued by your bank. When you buy with a debit card, cash is moved from your account into the merchant's account. Many supermarkets let you draw cash, above what your groceries cost. And there's no ATM surcharge.