Ten years is a long way off, but that's precisely where long-term buy-and-hold investors should focus. We can't predict the exact price of an individual company or even the S&P 500 in 10 years; otherwise, we would already be billionaires. But savvy investors understand that investing in competitively advantaged companies can create market-beating returns, especially at today's depressed prices.

Consider Veeva Systems (VEEV -0.50%), which provides specialized software to drug companies. While Veeva's stock has cratered this year, its superior business model gives it a massive advantage over its competition. Moreover, Veeva is experiencing huge growth in a new segment that most investors may not be aware of yet. Here's a closer look.

Veeva turns a problem into an opportunity

Medicine is a highly regulated industry, and rightfully so. Big pharma and biotech companies face a monster challenge dealing with complex and extremely time-consuming medical compliance. What makes matters worse for the companies is that each country in which they sell their drugs and therapies has its own expansive set of rules and regulations with which they must comply.

But it gets worse. Each company is racing to get its products approved by the FDA and similar entities abroad -- and time is money. That's where Veeva comes in. What pharmaceutical companies see as a problem, Veeva sees as an opportunity. The company's suite of cloud-based medical compliance software aids its pharma and biotech customers in navigating a complex and onerous regulatory environment, getting their drugs to market faster, and earning investors a higher return on their capital.

Computers connected to a cloud icon.

Image source: Getty Images.

Here's how they do it

Veeva offers its customers an expansive, a la carte suite of software-as-a-service (SaaS)-based medical compliance software Its Veeva Development Cloud includes apps for clinical, regulatory, quality, and safety functions. The platform gives users the functionality to handle data from clinical trials, streamline study execution, and manage documents and compliance reporting.

The Veeva Commercial Cloud segment sells a suite of collaboration software that helps medical departments save, search, and share compliance data globally. Marketing departments can optimize data for media campaigns aimed at patients and healthcare professionals in a compliant and privacy-protected manner.

Sometimes customers hire Veeva for a large swath of services that fit their particular needs. Other times, customers will initially buy the highest-priority services and add more over time as they see the value in Veeva's offerings. Veeva is a digitally-based company, so adding new customers or selling additional software to an existing customer comes at a very low cost. And each new dollar of revenue generates more profit than the last. Veeva's gross margin history demonstrates how the company has become more profitable over time.

VEEV Gross Profit Margin (Annual) Chart.

VEEV Gross Profit Margin (Annual) data by YCharts.

The massive problems that Veeva solves for its customers not only keeps customers entrenched with the company and also keeps the competition at bay. Veeva has some competitors in a few of its software offerings, but duplicating the company's entire interoperable software suite would be an undertaking of epic proportions.

Limited competition affords Veeva the luxury of pricing power. Customers aren't likely to replace Veeva because, frankly, there aren't many options.

Another growth driver for the next decade

Big data is quickly becoming essential to every business, especially pharma and biotech companies. With access to an incredible amount of sales and medical data, Veeva debuted its Data Cloud business (which includes its Veeva Link and Veeva Compass offerings) in 2021 and concluded the year with 10 early-adopter customers.

And during the first quarter of 2022, Veeva attracted eight  new Veeva Link customers, nearly reaching its 2021 total in a single quarter. The second quarter was even better. Ten new Veeva Link customers bought the service, and four added Compass. I'll save you the math; that's 120% growth through only the year's first six months.

The business is nascent and doesn't yet have a meaningful effect on the company's bottom line. But with an expansive customer list to market the new business, Veeva is in a position to quickly scale the platform.

Where will Veeva be in 10 years?

Veeva's competitive advantage, growth potential, and expanding margins give its stock a great chance to outperform the market over the next decade. It has certainly worked out well for investors so far. If you'd invested  $10,000 at the initial public offering in late 2013, you would now have just a bit over $85,000. That represents a staggering 32% compound annual return.

By comparison, the S&P 500 would've risen to about $22,500 -- or an 11% annualized return. So Veeva shareholders have handily outperformed the market since its IPO.

The tables have turned this year, though. Veeva stock has crumbled 34%, nearly twice as bad as the S&P 500, which has shed only 19%. On the bright side, that has afforded investors the opportunity to buy the shares at almost the lowest valuation seen in a year.

VEEV PE Ratio Chart.

VEEV PE Ratio data by YCharts.

The stock's drop this year means its price-to-earnings (P/E) ratio has also fallen to 69 versus nearly 125 in the fourth quarter of 2021. That might still be lofty for some investors, but consider this: Wall Street expects Veeva's earnings per share to grow by 57.7%  to $4.15   in its current fiscal year (ending Jan. 31, 2023), just a few short months away. Based on that forecast, the stock's forward P/E ratio drops to 41 -- its lowest in a year.

Considering today's valuation and the company's potential growth story, investors adding Veeva to their portfolio at today's price stand a great chance of looking back at a stock that outperformed the index once again.