The banks must be getting a piece of that because MC/Visa collect more depending on the rewards tier the card is in (Infinite/Signature/World and whatever other names they have).
Also, MC/Visa charge basically nothing for debit cards, and they do not take on any of the chargeback/default risk of credit cards, so I assume the rest of the fees are for the rewards for the most part. Which is why Discover/Amex fees are similar too.