Because regulations which goverments supports because they prefer digital transactions to physical money for several reasons. (EU country perspective)
By VISA/ MasterCard contract backed by governments' regulations a merchant in EU can not charge more because he's using a card instead of cash. Of course the transactions costs are paid by the customer, it's just all customers instead of those paying by card.
That's why some cards have charges, to the merchants, of around 2%... because the customer who use that cards does not pay them.
If I, as a customer, when doing an Amazon checkout saw a 2% charge to use VISA I would drop them in a second. Because that's hidden on purpose, I keep using it.