With debit card you hand the merchant your whole bank account and trust them to deduct an agreed amount. With credit card it becomes the bank’s problem.
Anyway it doesn’t have to be like this. In China you scan a merchant code and enter the amount you want to pay on your phone, much like a bank transfer, but it happens instantly.
Good point on this - if some merchant cheats you, you have a decent chance with CC company to get the money back. With debit, your money is gone, good luck getting a refund.