(Credit to @nathanwww's answer. Here I merely add a few details.)
The Dow Jones Industrial Average (DJIA) was first published at 40.94 on 1896-May-26. It closed at 24,448.69 on 2018-Apr-23. Let's call that 122 years. That's a 5.4% annual compound growth rate — certainly faster than the US GDP growth rate over that 122-year period.
However, the list of constituent companies that go into the computation of the DJIA has changed over time. The initial list contained just 12 companies, of which only one (General Electric) still survives.†
Almost by definition, the stock market consists of only companies that haven't completely failed. And so the average company listed on a stock market is more successful than the economy's average company.
Even if we look at broader indices or even a country's entire stock market capitalization, we will find that the same is true (albeit to a lesser extent) — in most countries, over long periods of time, the stock market grows faster than the country's GDP.
(The above is just 20 minutes worth of "research". I'd be interested to know what estimates researchers have come up with to quantify such survivorship bias and explaining the gap between GDP and stock market growth.)
Related point:
The stock market is not a representative sample of the entire economy.
For example, it is perfectly possible that one neighborhood of a city consistently gets richer faster than the rest of the city, perhaps because ever-richer folks keep moving into that neighborhood.
It is likewise possible that the stock market (which does not exactly reflect the entire economy) consistently attracts ever-more-successful companies.
(This is just one possible reason for selection bias; there may be others.)
† The 12 companies initially listed on the DJIA were (source):
- American Cotton Oil Company
- American Sugar Company
- American Tobacco Company
- Chicago Gas Company
- Distilling & Cattle Feeding Company
- General Electric
- Laclede Gas Company
- National Lead Company
- North American Utility Company
- Tennessee Coal & Iron
- U.S. Leather Company (preferred)
- U.S. Rubber Company
Here's a brief article stating what happened to each of the above companies. It is probably safe to say that if the DJIA stuck to these 12 companies and no matter what method we use to measure the present-day value of these 12 companies, the DJIA would be much lower than its current value of 24,000+.
Today's list of 30 companies that make up the DJIA, according to CNBC.