How debit cards work:
Customer making a purchase swipes his card at checkout counter.
Information about the customer and purchase is transmitted over a network to the merchant's bank.
The information is then sent to the customer's bank. It verifies the customer's account, checks for stolen or lost cards, and determines whether the customer has enough money in his account to cover the purchase.
The customer's bank then sends a message back either authorizing or denying the transaction.
Meanwhile, the merchant's bank collects a fee from the merchant, which is included in the price of the item. The merchant's bank pays an interchange fee to the customer's bank and a smaller fee to the network for its service, and keeps a fee for itself. The customer's bank also pays a fee to the network. Other fees are possible.
Actual payment for the item, made by the customer's bank to the merchant's bank, usually occurs by the end of the business day, often instantaneously. The payment of fees varies - it can occur immediately, at the end of the day or later.