Shopify's (SHOP 3.36%) stock has fallen far from its highs in recent months, but over the long term, it has produced some incredible returns. If you had invested $2,500 in Shopify stock at the beginning of 2016, you would have $27,500 today.

The e-commerce enabler has benefited from the long-running tailwind of consumers spending ever more money online. However, that's also part of the reason why the stock has fallen in recent months. After online spending as a percentage of overall spending soared during the earlier phases of the pandemic, its growth rate is now falling faster than expected. 

The rise of online shopping fuels Shopify's growth

Government-mandated business closures forced people to spend more time at home in 2020 and 2021. Many people simply didn't have the option to dine at restaurants, shop in malls, visit theme parks, or go to ball games, and even after the enforced shutdowns ended, many people still largely avoided them. This concentrated consumer spending on e-commerce channels, so brick-and-mortar businesses that wanted to keep making sales needed an online presence. 

Shopify, which helps businesses create and expand their e-commerce websites, experienced a surge of signups. Shopify also makes money by taking a small percentage of all spending that occurs on its platform. Merchants appreciate Shopify's differentiated offering because it gives them more control over their customer relationships compared to rivals Amazon (NASDAQ: AMZN) and eBay (NASDAQ: EBAY). For instance, when I sell items on eBay, I am not given the buyer's email address. 

Now that vaccines are widely available and the COVID-19 threat evolved into an endemic situation, folks are unleashing their previously pent-up demand for away-from-home experiences. The reversal of the online spending boom slowed Shopify's blistering growth.

SHOP Revenue (Quarterly) Chart

SHOP Revenue (Quarterly) data by YCharts

From 2012 to 2021, Shopify increased its revenue from $24 million to $4.6 billion. Despite the recent fluctuations of e-commerce, the long-run trend has consumers shopping more online. Visiting a website to buy something offers several advantages over patronizing brick-and-mortar stores, including shopping in the comfort of your home, avoiding the search for parking, and at-home delivery.

According to Statista, e-commerce spending as a percentage of overall retail spending was 14% in 2020. That figure is forecast to rise to 22% in 2025. Beyond that, it's reasonable to assume it will continue trending higher. I don't think there will ever come a time when 100% of shopping is done online, but I am confident that e-commerce's market share will trend higher from here.

SHOP PS Ratio Chart

SHOP PS Ratio data by YCharts

Is it too late for investors to buy Shopify stock? 

The short answer is no. Shopify is riding a powerful tailwind with years of growth. The company has done an excellent job of serving merchants who needed to establish an online presence and expanding its offerings. Moreover, after falling by 81% from its high, the stock is not expensive. It trades now at a price-to-sales ratio of 8.1, which is the cheapest valuation by that metric that investors have ever been able to purchase Shopify.

Shopify may not reprise the incredible 1,000%-plus gain that it delivered since 2016, but today's investors can reasonably expect the stock to be worth more several years from now.