In the stock market, past performance isn't a guarantee of future returns, but it is a useful screening tool for investors. 

That's because stocks that have a history of outperforming the market are more likely to continue to do so. A history of outperformance demonstrates that a stock has consistently beat expectations, management knows how to execute, and the company has a long runway for growth. It's also much easier for investors to catch a ride on a winning stock rather than time a turnaround play correctly or find an undervalued stock on the verge of breaking out.

With that in mind, keep reading to see how two niche tech leaders, Shopify (SHOP 4.90%) and The Trade Desk (TTD 4.15%), have turned $1,000 into $30,000 in just a few years.

An investor on a computer with a rising stock chart superimposed

Image source: Getty Images.

Shopify: Dominating the intersection of e-commerce and SaaS

Like so many business success stories, Shopify's creation was something of a happy accident. Founder Tobi Lutke opened an online snowboard shop in 2004 but found that the available e-commerce software at the time was unwieldy and expensive, so he made his own. Two years later, after receiving positive feedback from other online entrepreneurs who had asked to license the software, Shopify was born and Lutke pivoted from snowboards to e-commerce software. Since its IPO five years ago, the stock has returned nearly 5,000%, turning $1,000 into more than $50,000. 

Today, Shopify is the dominant software platform for running e-commerce business -- strong enough to cause Amazon to pull the plug on its own competitor, Amazon Webstore, several years ago, and well ahead of rival and recent IPO BigCommerce.

Shopify has benefited from fast-expanding markets in both e-commerce and cloud computing, as a provider of software-as-a-service for online retailers. And its rapid growth, especially during the pandemic, is a testament to that opportunity. Through the first three quarters of 2020, Shopify's revenue has jumped 82% to $1.95 billion, and the company's leadership in the sector has contributed to its competitive advantages.

For instance, over the years, the bulk of Shopify's revenue has shifted from subscriptions solutions, the base rate that its merchants pay for its software, to merchant solutions, which are add-on products like payments, shipping and fulfillment, and access to capital. By making its merchants successful, Shopify grows as its merchants do. When they upgrade to more expensive subscription packages and consume more merchant solutions, Shopify wins.

That has created a powerful ecosystem for the company, and its on track to generate more than $100 billion in gross merchandise volume this year -- making it the second-biggest e-commerce business in the U.S., behind Amazon. And its margins are quickly improving as well.

The Trade Desk: A revolution in advertising technology

The Trade Desk is something of an oddity in the tech world -- a high-growth stock that is also highly profitable. 

The company was founded in 2011 with the mission of transforming media. It began by targeting display advertising and has since expanded to mobile, video including connected TV (CTV), audio, native, and social channels. It operates a self-service, cloud-based, demand-side platform for advertisers, primarily ad agencies, which allows advertisers to create, manage, and optimize ad campaigns.

The Trade Desk is riding a growth wave in ad technology, and stands to be a big winner from the evolution of CTV, or ad-based video streaming. This will open up a giant new ad market, since linear TV still accounts for roughly a quarter of total ad spending in the U.S.

In its most recent quarter, The Trade Desk's revenue jumped 32% to $216.1 million, and it generated a generally accepted accounting principles (GAAP) net income that more than doubled to $41.2 million, giving it a profit margin of nearly 20%. On an adjusted EBITDA basis, the company posted a profit margin of 36%, making it one of the most profitable tech stocks around.

The Trade Desk collects revenue based on a percentage of a client's total advertising spend, as well as by providing value-added services like data sharing. That model, combined with the self-service, cloud-based setup of its platform has proven to be highly profitable and a hit with clients, as its retention rate is above 95%. The stock has soared this year as excitement has built around the growth potential in ad technology, especially as the pandemic has helped accelerate the shift toward digital advertising like connected TV. CTV spending on The Trade Desk more than doubled in its most recent quarter, further evidence of these tailwinds.

Shares of the Trade Desk have jumped 3,000% since its 2016 IPO, turning $1,000 into more than $30,000. As with Shopify, The Trade Desk's success shows the power of being a market leader in a fast-growing, tech-driven industry. That status is unlikely to change in the coming years.