That's often how takeout food works? I'd guess that might have to do with the transactional relationship held between a restaurant and a customer, low margins on product, or optimizing your process for convenience and fast pickup.
Takeout food generally works on credit card payments, and those definitely aren't settled before food is delivered (merchants generally get the funds many days after the transaction); and more importantly aren't settled irrevocably. The vast majority of business relies on the ability to revoke settlements in case of disputes, and especially so for remote transactions - e-commerce couldn't possibly have the widespread adoption it has if card payments didn't have a reasonably working chargeback process.