It might appear that way, but that is only because the fee is hidden.
The credit card terminal agreements signed by retailers prevent the retailer from offering differential pricing when buying via credit card or cash. Essentially, the credit card fee is embedded into the price.
This might be "good" for people who have credit cards, but it is inflationary (by roughly 2%) to people whose credit is poor and only transact by cash.