Digital data is stored on swipe cards on the magnetic strip - this strip is essentially the same stuff as the magnetic tape found in audio and video tapes; it is trivial to 'make' a swipe card from a piece of card and strip of video tape. As you swipe the card past a pick-up coil, the changes in magnetization are converted into a changing electrical current. Recording is achieved in exactly the opposite way.
In commercial security systems, it is usual that the only info on the card is an ID number - everything else is stored on a central server.
The server contains information about which doors you can open, how much credit you have on your account, etc. Most servers also keep a record of when and which doors you opened/attempted to open, etc. to allow auditing and detection of suspicious behaviour.
For extra security, some systems, as well as storing the ID number on the card, store a password. The first stage of verification is for the server to check that the password matches that stored in its database. This prevents a hacker just programming 100 or 1000 cards with random ID numbers in the hope that he will find some that work.
Some variants of this system also include an encrypted copy of the data on the card. The card reader is then able to decrypt the security data and check it with the unencrypted data. This check can be done without access to the central server - this means that even if the network or server is compromised and ID numbers and passwords obtained, it still won't be possible to make fake cards.
A few years ago, a massive operation to rip-off ATMs was uncovered in the UK. When raided they were found to have hundreds of custom made 'spyware' replacements for telephone exchange line cards - the plan was evidently for insiders at the tel. co.s to swap out the line cards serving banks and ATMs are replace them with the modded versions which would harvest the traffic.
It is unclear if they would have succeeded even if they had not been caught - for a start all communications to/from ATMs are encrypted, and also the cards are protected by a mechanism similar to that described above, so that even if they had obtained valid data, they couldn't have made any fake cards.