When the customer uses a debit card he/she has the option to type in a PIN number. When the PIN number is typed in the transaction is sent over the same network that runs ATM machines. Since the ATM network is newer and has more competition, these transactions are usually the cheapest.
When no PIN is entered, the transaction is sent over the Visa and Mastercard networks. Since Visa and Mastercard have a monopoly, the transaction is more expensive when processed this way.