Visa and Mastercard make a highly complex payment system look easy to consumers. They also have developed a high level of trust with consumers and businesses.
It is a two sided market. I know I can go out with a credit (or debit) card in my wallet and use it in many places, the vendor knows that most people have a payment card so it is worth it for them to work with the incumbent. Starting out from zero you have a much harder time.
They also play a mean game of political engineering. Since they work closely with banks there are local and regional banks in every legislative district. Vendors complain about high fees, but some of those fees get kicked back to consumers in the form of “points”; consumers see that, they don’t see that everything is a little more expensive even if you don’t use credit because vendors are forced to build those fees into their prices.
Note it isn’t free to handle cash so comparing 3%-ish fees to 0% is wrong since cash is attractive to steal for both employees and others and requires time safes, armed guards, etc.
Note American Express and Discover are both alternative payment cars that look the same to the consumer but worked differently from a business perspective at least until the 2008 crisis. Then there are the Paypals and Venmos and M-PESAs of the world which there are an awful lot of because there are so many countries where Visa and Mastercard are not as entrenched.