Unlike with a debit card, you can actually spend more money than you have — that's not something you should do, but in the event of an emergency like a car accident or travel hiccup, you can spend more money than you have in your bank account without the worry that you'll incur a fee for doing so.
However, you can get charged an over-the-limit fee if you exceed your credit limit, even if it's because of interest charges, but you have to opt in to over-the-limit fees. You should always try to keep your credit card balances as low as possible relative to your credit limit, because a high debt-to-limit ratio on your credit card can negatively impact your credit score.