In the midst of all the chaos caused by the pandemic, recession, and civil unrest in 2020, the stock market performed surprisingly well despite falling sharply in the first quarter of the year. Over the past 12 months, the S&P 500 is up 17%.

Could this year turn out to be just as perilous as the last? That seems unlikely, but regardless of what happens, some stocks should continue to perform well through it all. Two such stocks are Intuitive Surgical (ISRG -0.21%) and Shopify (SHOP -0.99%). Here is why both companies are worth adding to your portfolio to weather whatever storms may come in 2021.

^SPX Chart

^SPX data by YCharts

1. Intuitive Surgical 

Any technology that improves our ability to treat life-threatening illnesses is likely to find some success on the market. Intuitive Surgical's robotic-assisted surgical devices help doctors perform minimally invasive operations. Compared to open surgeries, these procedures result in smaller incisions, shorter hospital stays, and faster recovery times. In other words, both the patient and the hospital benefit immensely from these devices.

Intuitive Surgical markets the da Vinci robotic surgical system, one of the leading such devices on the market. As of Dec. 31, the company had 5,989 da Vinci Systems installed worldwide, representing a 7% gain compared to the end of 2019. The number of elective surgeries actually performed with the crown jewel system dropped as a result of the pandemic, hurting its top line.

Overall revenue too was down 3% in 2020 compared to the previous fiscal year. The company will continue to deal with these headwinds for the duration of the pandemic, but in the long run, it should be just fine, for a couple of key reasons.

Piggy bank wearing a face mask on a table surrounded by coins, documents, and a man sitting at the desk.

Image source: Getty Images.

Intuitive Surgical is building a powerful competitive advantage. The company benefits from high switching costs: Once a hospital has spent between $500,000 and $2.5 million to acquire the da Vinci System, has dedicated long hours training its staff on this device, and has spent even more to purchase the accompanying instruments, switching to a competing machine is an expensive proposition.

Even in case of technical issues with the da Vinci, it is easier for hospitals to fix it than replace it. Intuitive Surgical also provides maintenance services to its clients. Thanks to these factors, the healthcare company should keep most of the customers it already has.

And it has already jumped through a host of regulatory hoops to launch the da Vinci System on the market. The stringent regulatory landscape of the healthcare industry is a bonus for companies that are already well established, like Intuitive Surgical. 

The company should continue to profit from increased adoption of robotic-assisted surgery, which is set to grow at a compound annual rate (CAGR) of 19.9% between 2021 and 2026, according to the research firm Mordor Intelligence. And with an aging population, the need for innovative devices like the da Vinci will only increase. These long-term tailwinds should provide Intuitive Surgical with enough fuel to continue to rapidly grow its revenue, profits, and stock price. 

2. Shopify

The e-commerce space is crowded, with dozens of companies battling for supremacy. Shopify has found tremendous success in this sea of competitors by marketing itself as a one-stop-shop for small and medium-size businesses looking to build an online presence. Shopify makes it easy for them to sell and ship their products, process payments, and much more.

The company has also built a competitive advantage: Like Intuitive Surgical, it benefits from high switching costs. It is expensive and time-consuming for businesses to create an online store and attract customers. After going through this process, few business owners would want to switch platforms and start from scratch, meaning Shopify is likely to retain the bulk of its clients.

It continues to record excellent financial performance. During the third quarter, which ended on Sept. 30, its subscription solutions revenue jumped by 48% year over year to $245.3 million, in part due to an increasing number of merchants on its platform.

The tech company's merchants solutions revenue soared by 132% to $522.1 million, thanks to the growth of its gross merchandise volume (the total value of items sold on its platform). Its total revenue jumped by 96% year over year to $767.4 million.

Smiling woman holding a clipboard inside a warehouse.

Image source: Getty Images.

Unlike Intuitive, Shopify got a boost because of the pandemic last year, as consumers relied more heavily on online shopping. But investors have become used to terrific revenue growth over the years, and that trend isn't about to end. Analysts see the company's top line increasing at an average rate of 105.4% per year through the next five years.

The U.S. Department of Commerce says e-commerce accounted for just 14.3% of total sales in the third quarter. As that number continues to grow, more merchants will look to reach customers online, and many of them will no doubt turn to Shopify. These factors make it an excellent stock for those trying to crush the market from here on out.