Bull markets typically don't last 20 years, but over the course of a couple of decades, there will be at least several bull runs. There will be downturns, too, of course. However, equities will almost certainly see a sustained upward run, at least if the past is any indication. Cashing in on the market's long-term rise means buying shares of companies that can perform well come the next bull market and beyond.

Here are two excellent candidates: Intuitive Surgical (ISRG -2.10%) and Shopify (SHOP -2.60%). These companies are well positioned to deliver market-beating returns and join the exclusive $1 trillion club in the next two decades. Here's the rundown.

1. Intuitive Surgical

Intuitive Surgical's current market cap is just under $100 billion. To become a trillion-dollar company, the company would need to register a compound annual growth rate (CAGR) of about 12.2% during the next 20 years. The medical device giant has delivered outsized returns thanks to its leadership in the robotic-assisted surgery (RAS) market.

ISRG Chart

Data source: YCharts.

The vast opportunities still available in this market are what can allow Intuitive Surgical to deliver above-average returns again. Here is just one example. One key determinant of the company's revenue is the number of procedures performed with its crown jewel, the da Vinci system. These devices cost between $500,000 and $2.5 million, but physicians have to order instruments and accessories to perform various operations.

The more procedures, the higher Intuitive Surgical's revenue. Instruments and accessories now make up more than 60% of the company's top line. In the second quarter, the company's revenue increased more than 15% from a year earlier to $1.8 billion. Instruments and accessories revenue was about $1.1 billion.

However, robotic surgeries still make up a small percentage -- less than 5% by some estimates -- of the total number of eligible procedures, despite the advantages they confer by allowing for minimally invasive procedures (less cutting of the skin and smaller incisions, less bleeding, faster recoveries). That's why, in the next couple of decades, the RAS industry should continue on its upward path. The total number of procedures -- including those performed robotically -- will grow too, as healthcare spending increases and the world's population ages.

Further, newcomers shouldn't be able to dethrone Intuitive Surgical thanks to the company's economic moat that comes from multiple sources, including high switching costs due to the price of its da Vinci systems and the company's patents that protect its devices from the competition. We can also mention the incredibly high barriers to entry in this industry -- starting from the extremely challenging task of building a robotic system and then having to jump through a maze of legal hoops to earn regulatory clearance.

The entire process can take years, and it's a process Intuitive Surgical has already completed with its most important product. The company should have little to worry about, even with several more companies entering the field. Shareholders who hang onto the company's shares through the next 20 years have an excellent chance of coming out of it with substantial gains. 

2. Shopify 

Shopify's market cap is almost $69 billion as of this writing. A CAGR of 14.3% through the next 20 years would make it a $1 trillion stock. The tech giant has been a bit of a market darling since its 2015 initial public offering, and despite giving up much of its gains in recent years, it has easily beaten the market in this period.

SHOP Total Return Level Chart

Data source: YCharts.

But Shopify could be just getting started. The company's goal of becoming a one-stop shop for all the things merchants need to open and run successful online stores will provide the company with plenty more opportunities tied to the growth of the broader e-commerce industry. How much more can online retailers replace traditional brick-and-mortar stores?

It's hard to say precisely, but even in the U.S., a country with relatively high e-commerce penetration, online sales accounted for just 15.4% of total retail sales in the second quarter. But with fierce competition in this field, can Shopify come out a winner? The answer is a resounding yes. First, consider that the company has built a reputation as a leader in what it does. Brand names matter.

Second, the company benefits from high switching costs -- merchants having spent time and money building and customizing a successful online store from scratch with Shopify will be reluctant to take their business elsewhere. As of the end of 2022, Shopify had a roughly 10% e-commerce market share in the U.S. by gross merchandise volume.

Although the company remains unprofitable, recent changes will help it turn turn a profit faster. Shopify decided to give up its expensive and low-margin logistics business to focus on its core e-commerce operations. Profitability is on Shopify's mind, a great sign for investors. It might not come for a few more years, but the company's competitive advantage and the whitespace available in the industry should help it grow by leaps and bounds in the coming couple of decades.