The simple answer is different transaction approvals flow through different paths.
When you use a debit card the processor has to ask your bank if it’s okay. When you use a credit card the processor can either ask the credit card company if it’s okay, or if they aren’t available go through a series of protocols to determine if it’s okay.
As a side note you should almost always use a credit card for transactions, the federal protections for credit card users are far superior to debit card users. For instance if you have fraudulent charges in a credit card the companies have to remove it immediately and run a chargeback to the store. Your bank can take days to weeks to determine if they are going to give you your money back.
Latest Answers