Let's say its March 2009. You've been lucky enough to keep your job during the Great Recession, and you've saved up $10,000 to invest. Predicting the growing importance of e-commerce, you choose to split it evenly between two first movers in the trend: Amazon (AMZN -0.15%) and MercadoLibre (MELI -1.18%).

By the summer of 2019, that investment was worth ... almost $400,000! Obviously, I'm cherry-picking my start date, but it's to highlight an important point: These two companies share a secret in their structure that is identifiable and has allowed them -- and their shareholders -- to compound their returns for more than a decade. And it's not simply that they focus on e-commerce.

If you can spot the secret, you'll have a huge head start in learning how to invest in stocks ... and finding the ones that create dynastic wealth.

Pop art-style comics panel of a gossiping man whispering a secret in ear of surprised person with speech bubble.

Image source: Getty Images.

The secret to the success of companies like Amazon and MercadoLibre is:

  • A willingness to build tools that served a core business -- and then let those tools loose in the marketplace.

Let's dig into what that all means in the real world.

Don't pay attention to the Everything Store, pay attention to the tools built for it

Most Americans think of Amazon as the Everything Store: an online location where you can buy just about anything. They aren't wrong. The site has increasingly become the go-to place for e-commerce.

But investors need to take a different view. Instead of focusing on the Everything Store, focus on the tools that Amazon has built to make the Everything Store function.

Here's what I mean. Today, Amazon Web Services (AWS) is the leading profit machine for Amazon. But it wasn't always this way. As the Everything Store grew before the turn of the millennium, Amazon dealt with a jumbled mess of different internal computing systems. In 2003, when executives went on a retreat with CEO Jeff Bezos to identify their core competencies, they realized something funny.

From a 2016 Tech Crunch article:

"[Amazon realized] they had become highly skilled at running reliable, scalable, cost-effective data centers out of need."

They then turned that expertise -- an expertise they didn't originally set out to master but did need to have for the Everything Store -- into a stand-alone business.

The same thing has happened with Fulfillment by Amazon (FBA). The company currently has a network of more than 150 fulfillment centers in the U.S. and well over 100 abroad. That helped them to ship Amazon packages to houses with two-day or even one-day delivery when no one else could.

But another funny thing has happened: Amazon decided it didn't need to be the vendor for all its products. It was easier to just open the fulfillment network up to third-party vendors who provide the inventory. Today, 58% of the stuff sold on the site isn't even from Amazon, but the company still gets high-margin revenue thanks to FBA.

The details were different, but the blueprint was the same: build tools (AWS/FBA) for internal use on the Everything Store; get really good at them; open those tools up to others; rake in the profits.

MercadoPago is taking over

The same dynamics have played out at MercadoLibre. When the company went public in 2007, the MercadoLibre marketplace -- akin to eBay -- was the core business.

At the time, it had a much smaller tool called MercadoPago. The tool was crucial to making the online marketplace work. Because of a massively unbanked population, most Latin Americans paid for things in cash only. But you can't pay in cash for goods you buy online.

MercadoPago solved that problem and, in doing so, helped grease the wheels of the core marketplace business.

But then a funny thing happened: Executives realized the potential for MercadoPago went far beyond just paying for things on the marketplace. So they opened it up for massive "off-platform" use. By 2016, mobile point-of-sale (mPOS) kits were being used in Brazil, Argentina, and Mexico by offline merchants.

Today, many in those countries pay electric bills, grocery bills, and other everyday expenses using MercadoPago. Here's what the growth in that spending -- both on and off the MercadoLibre marketplace -- has looked like.

Chart of MercadoPago payment volume growth over time

Data source: SEC filings.

And that's not all. The company has a number of other products that help serve the core marketplace: MercadoEnvios is an increasingly popular fulfillment and shipping option, and MercadoShops is a software-as-a-service (SaaS) option for merchants who want to build online websites.

Finding other companies with these traits

Of course, hindsight is always 20/20. While it's nice to identify two successful companies that have used this format in the past, it's far more useful to find ones that will utilize it in the future.

I think Amazon and MercadoLibre -- despite their massive run-ups in stock price -- are two such examples. But I don't think they're the only ones.

Shopify (SHOP 1.73%) has a core SaaS business that helps merchants set up shops online. But it has developed tools to complement that core business that have been (or could soon be) huge contributors to the bottom line in their own right:

  • Merchant Solutions helps these online shops collect payments and order shipping. Sales from this line of business actually exceed the core SaaS offering -- though at much lower margins.
  • The company recently announced merchants would have access to an independent fulfillment network to serve the core SaaS business.

Grand Canyon Education (LOPE 0.29%) used to be a for-profit educator. But in 2018, its namesake university -- Grand Canyon University -- returned to its not-for-profit status. That left GCE as a services company that provides technology, counseling, marketing, and other software-related services to Grand Canyon University and other schools around the country. It has taken all of the tools it developed internally to serve its once-core school and opened them up to others.

As a final example, Veeva Systems (VEEV 1.06%) has a core business of providing cloud solutions to the pharmaceutical industry. Its primary product in that regard is Veeva Vault -- an SaaS application that helps a drug company document everything from clinical trials to safety concerns.

But the tools were so popular that Veeva is now offering a slightly different version of Vault to companies outside of pharmaceuticals. It turns out that the internal development of Vault has equally valuable applications in other highly regulated fields -- like consumer packaged goods and chemicals.

Finding the next dynastic wealth creator

This list -- Amazon, MercadoLibre, Shopify, Grand Canyon, and Veeva -- is hardly exhaustive. The bigger point is simple: Find companies with a dominant core business.

But don't stop there. Take this subset and focus on those that are able to take internally developed tools and monetize them to broader audiences. When a company can do this, there is virtually unlimited upside potential. When that potential comes to fruition, it can make an enormous difference in your portfolio's returns.