You may have heard of the terms "compounding" or "compound interest" and wondered what they mean. To the great physicist Albert Einstein, compounding was simply the "eighth wonder of the world."

To Warren Buffett, chairman and CEO of Berkshire Hathaway, compounding is essential. "My wealth comes from a combination of living in America, some lucky genes, and compound interest," Buffett once said.

Person looking up at skyscrapers.

Image source: Getty Images.

Compounding, as it relates to investing, is the simple concept of your returns earning additional returns, and it is the basic element of how the stock market can help turn a relatively small initial investment into a six-figure sum given enough time.

The magic of compounding

Let's say you have a 401(k) (or other retirement plan) you contribute to at work, but you want to supplement that -- and your future Social Security -- with additional retirement savings. You have $10,000 you can invest in the stock market, but since you already put a percentage of every paycheck toward the 401(k), maybe you don't have any extra money right now to contribute on a regular basis after the mortgage, car payments, college tuition, and other bills.

But through the magic of compounding, that $10,000 investment can grow exponentially without you contributing any additional money. For example, say that $10,000 investment posts a 10% return in the first year, which is approximately the long-term average of the S&P 500. That $10,000 would gain you $1,000, so you'd have $11,000 total.

The second year, another 10% return would compound on top of that $11,000, so you'd also earn 10% on that additional $1,000 you gained the previous year. So now, you'd have $12,100 -- in essence, an extra $100 from the return on your prior earnings.

If you extrapolate this out for, say, 25 years, gaining 10% every year, you'd have over $108,000 with compounding, without contributing a single dime.

Dividend reinvestment

That amount could grow even bigger if you reinvest your dividends. Dividends are payouts that some stocks and exchange-traded funds (ETFs) distribute to shareholders from their excess earnings. So, say that $10,000 initial investment bought you 100 shares of a stock or ETF at $100 per share.

If that investment paid out a quarterly dividend at a 1.5% yield, which is roughly the average yield on the S&P 500, and the payout increased 5% annually, you would earn another $25,000 from reinvesting the dividends you receive, giving you nearly $133,000 after 25 years. And that's still without investing any additional money besides the dividends.

Now, if you were able to contribute an extra $50 per month to that stock or ETF, assuming you enjoy the same 10% annual return and employ the same dividend reinvestment strategy as laid out above, your holdings would be worth just under $200,000 in 25 years.

Keep in mind that this scenario is based on a stock or ETF that matches the historical performance of the S&P 500. If you invest that $10,000 in a stock that loses money, then you no longer benefit from compounding.

That's why a safe bet may be an ETF, which invests in all of the stocks of an index or customized benchmark, like the S&P 500. While past performance is no guarantee of future results, this popular index has averaged about a 10% return over the course of its long history. An ETF that mirrors it is a solid choice for a beginning investor, particularly one who doesn't have a lot of time to spend analyzing the markets -- but does have a lot of time to take advantage of the power of compounding.