The credit card company sets out in it's terms of business that the shop must not have a surcharge, and must charge the list price for good paid for by credit card. This is so that using a card is attractive to the customer.
The card fees can be quite high. High enough for there to be more money than the transaction really costs, and the credit card company can then offer some of this money back to customer to entice them to use this card rather than some other card that doesn't offer cash back.
The end result is that customers who pay cash are subsidising the prices of those who pay by card.
It's hard to break the cycle because if a shop doesn't offer payment by card, not many people will shop there as people don't carry much cash.
Amex have the highest fees. I don't know why shops even allow amex.
Also it's not just the ppl paying with cash subsidizing card usage. Cards that offer >1% cashback are usually more difficult to get, and targeted toward higher-spenders. These benefits are subsidized by the people using cards with no benefits.
Because some shops _do_ have an Amex, and as an Amex holder, I prefer stores that take Amex to ones that don't.