Thanks to their incredible profitability, powerful network effects, and growth potential, Visa (V -0.23%) and Mastercard (MA 0.07%) are two of the most outstanding businesses around. Their stocks have been huge winners in the past, both significantly outpacing the S&P 500 in the last 10 years.

The companies might be on your investing radar, so it's important to understand how these two credit card giants make money. Here's a closer look at the businesses of Visa and Mastercard.

Operating payment rails

Besides the customer and merchant, there are typically three other key parties involved in a card transaction. These are the customer's financial institution (issuing bank), the merchant's financial institution (merchant acquirer), and the payment network. All collect revenue in some form.

Anytime a card gets swiped, the merchant bears a cost, the biggest portion of which is known as an interchange. Some might think that this interchange fee, usually ranging from 1.5% to 3.5% depending on the card used and other factors, all goes to Visa and Mastercard. That's not true.

The interchange fee goes to the issuing bank. It's understandable why the customer's bank would get the largest chunk of a transaction's cost. The issuer has to find borrowers, underwrite them for credit cards, and handle payments. They take on the credit risk. Plus, they use the interchange fees to essentially fund credit card perks and rewards.

Anyone who follows the industry knows how much blame gets put on the so-called interchange fees. However, we can see that they serve a valid purpose. Visa and Mastercard have the power to set default interchange rates, but merchant and consumer banks can negotiate their own terms if they choose to.

On the other hand, Visa and Mastercard, which operate the underlying payment networks that connect all the different stakeholders, collect what's called an assessment fee, roughly 0.15% of a card transaction. This is a tiny part of what a merchant pays.

Given that in the last three months of 2023, Visa handled $3.9 trillion of volume and Mastercard handled $2.4 trillion of volume, the assessment fees can add up to tens of billions of dollars in annual revenue.

Because these companies are simply moving data around when processing transactions, their business models have scaled up extremely well. Both Visa (69% last quarter) and Mastercard (56% last quarter) report stellar operating margins.

Key risk factor

Besides being incredibly profitable, these companies run two-sided payments platforms that benefit from powerful global network effects. What's more, the long-term secular transition of cash to cashless commerce supports many more years of strong growth for Visa and Mastercard.

But that doesn't mean investors don't have anything to worry about. When it comes to dominant enterprises, regulation is always a concern. In this instance, lawmakers are always trying to find ways to lower the fees that merchants pay to process card payments. The thinking is that those savings would result in lower prices for consumers.

This is what the Durbin Amendment, enacted in 2011, tried to do when it came at debit card fees. However, studies have shown that there are minimal signs of consumer savings, as merchants likely reap the savings for themselves.

And feeling the need to make up for the lower interchange revenue, it's rare to see banks offer rewards or perks on debit cards. Additionally, free checking accounts are hard to find these days.

Visa and Mastercard have successfully navigated regulatory challenges in the past. All stakeholders understand the value these businesses provide for the smooth functioning of the economy. This protects their competitive standing.

As of this writing, shares of Visa and Mastercard trade at price-to-earnings ratios of 29 and 33, respectively. These aren't cheap on an absolute basis, but some investors might still find the stocks worth buying, given the high quality of these businesses.