According to a national study on millionaires, most of them are self-made. Just 21% of the millionaires who were in the study (the lucky ones) inherited some amount of money. The rest? Sorry, you're on your own!

So, how did the other 79% go from broke to breaking the bank?

I'm going to let you in on the secret: It's a force of nature. Albert Einstein once called it the eighth wonder of the world and said that people who understand it, earn it. Those who don't...pay it.

Being on the right side of this phenomenon can make you rich. It's made many millionaires already and will continue making many more. Here is what you need to know.

Compounding your way to wealth

I'm talking about compound interest. Or, for investors, compound investment returns. Very few people get rich by stacking up a million bucks one by one. Wealthy people get that way by using compounding in their favor. Too many people are familiar with the wrong end of compounding and don't realize it.

Have you ever carried a credit card balance? Did you ever notice how paying the minimum payment each month feels like it doesn't go anywhere? Credit cards charge high interest rates, often over 20%. Paying the minimum on a credit card bill is like scooping water from a sinking ship with a spoon. That's what compounding feels like when it's working against you.

When you invest, on the other hand, compounding works in your favor. Your portfolio might feel like it's not getting anywhere when you start. But the math builds momentum over time like a snowball growing as it rolls downhill. Eventually, your portfolio grows more from your existing investments compounding than from adding new funds.

Graphic representing compounding investment returns.

Image source: Getty Images

How the S&P 500 compounds

Unfortunately, not all stocks work out over the long term. That makes the S&P 500 arguably the most dependable stock market investment you can make. It's an index of 500 of America's biggest and best corporations.

In other words, it's a broader bet on America's economy. Many consider the S&P 500 index the gold standard for the U.S. stock market. When someone asks: "How's the market doing?" they're probably asking about the S&P 500.

The stock market can be very volatile at times. Generally speaking, it's nothing more than buyers and sellers pushing and pulling prices up and down.

Human emotions can affect how the market acts. Prices can rise to nonsensical levels when people get greedy, and they can fall jaw-droppingly low when people are afraid. But over time, the market has grown like the economy its stocks represent:

US GDP Chart

US GDP data by YCharts

The S&P 500 has historically returned between 9% and 10% annually on average. Again, it might fall 10% one year and rise 15% the next. But the further you zoom out, the closer it gets to its average. You can use that to examine hypothetical scenarios and see what your potential investment portfolio could look like.

Applying the Rule of 72

The Rule of 72 is one of my favorite tools for back-of-the-envelope math -- rough calculations you can do quickly. Simply put, dividing 72 by a growth rate will tell you how long it takes for a number to double. So, using the S&P 500's historical returns, investors can reasonably expect a dollar invested to double every seven years or so.

Now, take a look at what investing $10,000 in the S&P 500, typically via an index fund that mimics it, can do when given time:

Time Invested (years) Investment Value
0 $10,000
7 $20,000
14 $40,000
21 $80,000
28 $160,000
35 $320,000

Chart by the author.

A $10,000 lump sum invested when you're 20 could grow to around $320,000 by your 55th birthday. Notice how the final seven years created more wealth than the first 21 years? That's compounding. You see, the math works harder the longer you give it. Those people shouting from the mountaintops to invest as early as possible? They're not wrong.

Do you want to get funky? Pull up an investment calculator online and play with the long-term compounding when you don't just invest a lump sum but add monthly contributions. Getting very wealthy with stocks isn't some unreachable dream. But what happens is too many people put it off early in life, not realizing they're sacrificing their best compounding years.

Whether you're young or older, it doesn't matter. The best thing you can do for yourself is to start investing and let compounding work for you.