The S&P 500 index has traditionally been the go-to performance benchmark for the broader U.S. stock market. To this day, it remains challenging to beat it over the long term. The Nasdaq Composite is one index that has done so by a comfortable margin. It raises the bar when looking for truly exceptional investments.

What if I told you that Visa (V -0.23%) has not only crushed the S&P 500 but blown past the Nasdaq over the past 10 years, outgaining it 2-to-1?

Let's look at how Visa does it and whether that will continue. You've got to see this.

Visa and its network effects

Payment networks like Visa play an essential role in the financial world. Visa's digital network bridges the communication between merchants and banks. The payment network runs data back and forth, requesting and verifying the funds needed when you swipe your payment card.

It's a massive industry dominated by several prominent players, including Visa, Mastercard, American Express, Discover, and fintech companies like PayPal. However, Visa is the largest, with an estimated 61% market share in America and 40% globally. Payment networks make money by charging fees that amount to a small percentage of each transaction.

Visa's large size gives it a competitive advantage known as a network effect, where it grows more powerful as it grows larger. That's because it makes less sense for merchants and banks to work with other networks when Visa is already everywhere.

You can see this below. The chart shows Visa's return on invested capital (ROIC), which shows how much it returns on a dollar invested in the business. Over the past 10 years, Visa's ROIC has trended higher as revenue more than doubled.

V Return on Invested Capital Chart

V Return on Invested Capital data by YCharts.

This shows that Visa is becoming stronger -- it has a better cost position, pricing power, and efficiency as more people use its payment network.

Visa is a cash printing machine

Visa's ability to turn revenue into cash profits may be Wall Street's best. Visa generated nearly $20 billion in free cash flow on $33 billion in revenue over the past year. That's an impressive 60% conversion rate. I look for a rate of at least 10% to 15% from most businesses, so Visa is exceptional.

That much cash is bound to find its way into shareholders' pockets. The company pays a dividend. While it only yields 0.8% at today's share price, the dividend has grown by an average of 18% annually for the past decade. That means the payout is doubling every three to four years. Even better, the dividend payout ratio remains very modest at 19%.

V Revenue (TTM) Chart

V Revenue (TTM) data by YCharts.

Much of Visa's cash goes to share repurchases, shrinking the share count, meaning every share represents a larger piece of the business. Visa's outstanding shares have fallen more than 18% over the past decade.

Why Visa's outperformance can continue

The stock's future returns depend mainly on its valuation today and whether it can repeat its winning formula. Visa trades at a forward P/E of nearly 26. Analysts believe the company will grow earnings by an average of 14% annually, which creates a PEG ratio of just under two.

That signals that Visa stock isn't cheap; I like to see a PEG ratio under 1.5. However, one could argue that is a fair valuation because Visa is such a high-quality business producing cash profits more efficiently than most.

V PE Ratio (Forward) Chart

V P/E Ratio (Forward) data by YCharts.

There is also no apparent reason why Visa's business won't grow as people worldwide adopt non-cash payments, and management continues to lower the share count. That is the long way of saying this: Buy Visa stock when the price is fair and hold it for the long term.

Visa's share price seems reasonable today, so consider adding the stock to your long-term portfolio.