If you're looking for stocks that have the potential to deliver massive long-term returns, sometimes it pays to start small.

For example, a decade ago, Nvidia's market capitalization stood at roughly $8.3 billion. Today, the company is valued at roughly $1.15 trillion, which means that a $10,000 investment made in the stock 10 years ago would now be worth nearly $1.4 million.

NVDA Market Cap Chart

NVDA Market Cap data by YCharts

If you have your financial bases covered and have $10,000 comfortably available to invest, read on for a look at two promising companies with market capitalizations below $5 billion that have the potential to deliver fortune-making performance over the next 10 years.

1. SentinelOne

As work processes and everyday communications continue to migrate to digital channels, the demand for high-performance cybersecurity services will only increase. With more valuable information being transmitted and stored digitally, bad actors have more incentives to carry out attacks. Additionally, the rise of artificial intelligence (AI) technologies will make it easier for cyber criminals to construct and carry out breaches.

SentinelOne (S 1.70%) is a company that's helping to counteract this increase in cybersecurity threats, and it's employing its own AI technologies to identify and stamp out threats. The company's software helps protect cloud workloads and endpoint hardware, including computers, mobile devices, servers, and Internet of Things devices -- and demand for its services has been growing at a rapid clip.

In the first quarter, SentinelOne's revenue grew 70% year over year to reach $133.4 million. At the end of the period, the company's annualized recurring revenue base had grown to $563.6 million -- up 75% compared to where it was at the end of the prior-year period.

The cybersecurity specialist is delivering robust sales growth thanks to new customer additions and expanding relationships with those already using its software. SentinelOne's customer count grew 43% year over year to reach 10,680 at the end of Q1, and existing clients increased their spending more than 25% on average compared to the prior-year period.

The company also saw substantial improvement on the margin front, with its non-GAAP (adjusted) gross margin rising to 75% from 68% in last year's first quarter. SentinelOne also has a strong balance sheet to work with, closing out its last reported quarter with cash and equivalents totaling $1.1 billion and zero debt. The software specialist does expect annual sales growth will decelerate to roughly 41% due to macro pressures, but that's still healthy growth, and the stock has big upside potential after a recent pullback.

With a $4.8 billion market capitalization, strong sales growth, improving margins, strong financial foundations, and long-term demand tailwinds at its back, SentinelOne is a mid-cap cybersecurity player that could deliver huge wins over time.

2. PubMatic

PubMatic's (PUBM 1.75%) platform automates digital advertising purchases and placements, making it possible for advertisers to have their content put in front of receptive audiences and get the most out of their campaign dollars. While the company's valuation shot to roughly $3.2 billion shortly after its December 2020 initial public offering, its market cap has been crushed by macroeconomic and industry-specific pressures.

The digital advertising industry is particularly sensitive to economic shifts. When macro conditions get tougher, companies cut back on advertising budgets to save money. Marketing also tends to be less effective when purse strings have tightened, giving businesses another reason to curb spending.

Like many other companies in the digital ads space, PubMatic has seen a substantial valuation pullback in conjunction with macroeconomic and industry-specific headwinds. With the company's share price down roughly 72% from its high, taking a buy-and-hold approach to the stock before the digital ads market rebounds could have big payoffs.

PUBM Revenue (TTM) Chart

PUBM Revenue (TTM) data by YCharts

While the digital advertising industry has been under a lot of pressure lately, PubMatic has returned to sales growth -- albeit at a relatively slow pace. Revenue rose 2% year over year in the first quarter to reach $54.6 million, aided by 13% sales growth for the company's omnichannel video business. The company also remained profitable on an adjusted basis, though per-share earnings in Q1 were down roughly 86% from where they were in the prior-year period

Even in the face of industry headwinds, PubMatic expects that it will roughly match the $38.3 million in free cash flow it generated in 2022 this year. The company is showing that it can adapt to lean times and continue growing in a cost-effective fashion.

With proven results in its corner of the programmatic ads space, the company looks like a smart bet on the recovery of the ads market. Big sell-offs have pushed PubMatic's market cap down to approximately $1 billion, and its stock could post explosive performance in conjunction with a recovery and return to stronger growth for the digital advertising industry.