Every credit card has some information stored on it which includes the limit available,card details etc
This information is accessed by the machine that is used for swiping the card.
The machine verifies the information and then it approves the payment,
When the payment is approved the transaction is cleared.
If there is some problem in terms of a mismatch then the transaction is declined,