Merchants pay the transaction cost. In my parents business in the early 2000s customers would ask in advance if they could use a CC. Some places installed ATMs in the corner (still a thing in some places), but quite unpopular. Rather than lose a customer the merchant will accept payment with credit card and pay the fee. One consequence of this system is the large merchants have more bargaining power and can negotiate…
This applies to cash as well. It takes a lot of time to count change for everyone. Plus all the ways there are to steal cash.
Your fun fact is wrong. Credit cards were always profitable. They were not in the beginning because scale is what makes them profitable. Anyone who uses their cards for a couple meals a month (which is what it was first started for) is going to cost money because of all the overhead to have you as a customer. In those days that was a stamp to send the bill, someone to open the payment and cash the check - now that everybody works electronically the overhead is lower, plus people are using it for more and so there is enough left over to pay for it.