It isn't a perfect system. The bank guarantees they will pay for any charges that the card digitally signed, and the bank will take any losses.
Most banks typically authorize the card to make ~$150 of payments or so offline. Anything bigger, or for risky customers or those with a low balance, it needs to be an online transaction.
The benefit of offline transactions is they can be done in under half a second, compared to the 5-10 seconds online transactions take. For things like opening the barrier in a car park, 10 seconds is too long.