Yes, but it is not as simple as that. The reason it is done this way is because an ATM needs to work without having to contact a remote location. Imagine being in some country where the communications links weren't very good etc etc, the ATM still needs to work, and securely.
In every ATM there is a set of keys. I don't know how many, but probably a fair number. On your card it will have a number that tells the ATM which key to use, along with a PIN number offset.
When you type in your PIN number, the ATM will subtract off the offset number, choose the correct key from its internal list, and use that to encrypt your PIN-offset (probably along with your card number too). It then compares this encrypted number with what is stored on your magnetic strip.
Note that because of the offset number stored, the encrypted number generated will always be the same, even if you change your PIN number. All that changes is the offset number that is stored on the card.
So, if someone were to steal your card they would have to get hold of all the "secret" keys that are used by the ATMs, and then go through every combination of PIN/key until they found a match with the data that stored on your card (assuming they couldn't work out which key to use from the million they had just nicked).
I assume the keys are pretty well protected, and will erase themselves when tampered with etc etc. Not sure if they change the keys regularly or not.