ATMs don't scan a deposited check or cash. They wait for someone in the bank to open it and determine whether it is legit, then the account is credited. But after a while your account becomes "trustworthy" and any deposits are credited to the account before it is checked.
Living in China, I can say that when you deposit, you deposit bills that go through a counter and counterfeit scanner. If any bills don't pass the test, they're separated out and given back to you. You can try to submit again if you wish. It's amazingly efficient and works well. I'm surprised we don't have similar machines in Canada from where I originally hail, especially after the currency revamps.
edit: I have no idea how depositing cheques (checks for you Americans! :D) works here though.
This is true outside the banks as well. If you make any purchase exceeding 250 USD (approximating a purchase requiring 10+ 100RMB bills), chances are the store will have one of these machines.
China is also the only country I've found myself in possession of counterfeit currency. Sigh, I guess I should just take the loss of 100 RMB but I keep thinking a little luck in a taxi could keep the system flowing...