It's actually a lot more complicated than that. This is going to be an oversimplified explanation.

To understand the situation, you have to identify all the players in a credit card transaction and the risk each take.

In a typical credit card transaction, there are usually six participants (Might be less, if say 4 and 5 are the same entity):

1) The Customer

2) The Issuing bank (The bank that backs the credit card the customer uses)

3) The network (Mastercard, VISA, Amex, Discover, etc.)

4) The Payment Processor (Chase Paymentech, etc.)

5) The Acquiring bank (The merchant's bank)

and lastly,

6) The merchant

Everyone sandwiched between the customer and the merchant takes on various risk and each takes a cut of the transaction.

The details are complicated and most of it covered with private business agreements.

Most people think that most of the fees go to VISA, Mastercard, etc. But this is incorrect.

Let's start with the issuing bank. If you have a Chase credit card, the issuing bank would be Chase. In credit card transactions, they usually take most (~60-80%) of the transaction fee. Why? Because they take on the risk of offering the customer a line of credit. The customer could default on payment, the card could be fraudulently used, etc. In addition to taking a big cut of the transaction, they also charge the customer interest on credit not paid back in full.

Next you have the network. They operate the network that binds all the banks together. They also take a cut of the fees.

Next you have the payment processor. They are responsible for verifying and checking payment details received by the merchant from the customer. They might also operate point of sale systems if it is a physical transaction. In either case, they make sure the transaction goes smoothly and the merchant is protected.

So finally, you have the acquiring bank. They are the bank the merchant uses to get paid. They also get a cut of the fees. Why? Because they take on the risk of the merchant's business. If charge backs happen often enough, the acquiring bank is fined by the network. This fine usually gets passed to the merchant by the acquiring bank, as in the case here.

So generally, the interest the customer pays goes to the issuing bank, the transaction fee is paid by the merchant, which is usually split between four entities, with the issuing bank taking the by far the biggest cut.

So why is this complicated system needed?

Simply because banks don't trust its customers and banks don't trust other banks. Everyone takes on risk and demands to be compensated for it. Think of all the thousands of banks in the world. They all do business differently, and they might not trust each other. The network provides the glue that binds them together, and the fees allows banks to take on the risk of doing business.

What about alternatives?

What if you want to cut out the middlemen? What if the merchant wants to deal with the customer directly? If you are a bigger company, this is indeed possible with 'store cards'. You are basically providing line of credit directly to the customer.

Yes, you skip paying fees to the banks and the network. However, you take on the big risk of providing customer credit. They can default, credit be used fraudulently, etc. Additionally, you would need underwriters to do credit checks on potential clients. This both impacts the customer's credit score and extra hoop to jump to purchase something on credit. Since the transaction fee is transparent to the customer for credit card transactions, you would need to provide incentive to the customer to jump through the hoop. This is usually done through attractive financing terms, gifts, rewards etc.

What about debit cards? There's still fees to the merchant because there is still risk involved in the process. Yes, the customer is not buying on credit, but all other risks are still present. Additionally, there is also infrastructure cost that must be compensated. From the merchant point of view, if customers are restricted by how much money they have presently, they might be less likely to make a purchase, resulting in lost sale.

So what about cash? That's surely perfect, right? No transaction fees?

This is not entirely true. If you operate a large retail company, you have tens and hundreds of stores that end up with thousands of dollars of cash at the end of the day. Where does the cash go? How does it get to the bank? For larger businesses, this usually means hiring a security company to transport the money. This results in significant cost to your business just to handle cash.

But what about small businesses that handles small amount of cash themselves? You still risk losing or getting the cash stolen, not to mention the possibility of the cash being counterfeit.

Lastly, cash is hard to use as a currency online.

Now i feel like i am mumbling and might have made some mistakes. In no way am i defending banks and various financial institutions, all i want to say is that handling payment is risky and hard and the existing infrastructure and fees for a reason.

Could it be better? Absolutely.