Even better, if you have $10 and also a $500 paycheck hitting your account that night, which is to say that the bank KNOWS there is no overdraft and that you have the money in the account, they'll process them in this order: -$12 (fee), -$4 (fee), -$3 (fee), +$500 (most eaten by the fees).
And some programmer programmed that for them. Intentionally.
They call it "maintenance". Like an account at $1995 needs some screws tightened or something. This isn't the 1920s. There isn't some clerk somewhere checking ledger sheets. It's all digital. It doesn't matter what value is in there. It's just a bit pattern.
In other "you have got to be fucking kidding me" moments, I once got charged a late payment fee on a loan that said I owed $0 that month because I had been making payments ahead for several months prior. Had a rainy day, needed some extra cash, figured since it said "you owe nothing this month" that meant I owed nothing that month. Apparently, buried deep in the promissory note, there is a term whereby I was required to pay a certain minimum every month, regardless of what the statement said.
They then used this as an excuse to jack up my interest rate. Aren't student loans grand?
I remember hearing about this a while ago, is that still going on? I thought some sort of regulation came into effect that prevented that, and that's why I was just then hearing about it.
Instead, your balance includes only processed transactions, whereas your account also has a list of pending transactions that can hit your balance at any time. Pending transactions can also disappear from your account, only to come back as a confirmed transaction. In effect, you can't be sure of exactly what's in your account unless you manually keep track of every charge you've made.
Banks do more than this to make overdrafts difficult to deal with. For example, Bank of America intentionally processes your transactions from largest to smallest, ensuring you'll git hit with the maximum number of overdraft fees.
e.g: if you have $10 in your account, and you make a $3 purchase, a $4 purchase, and a $12 purchase, they'll run the charges in the order of $12, $4, and $3, hitting you with three fees instead of one.
tl;dr: banks love overdraft fees and do whatever they can get away with to hit you with them.