It matters more when you start and when you want to get out. Take the Dow Jones Industrial Average (DJIA), for instance.
https://www.macrotrends.net/1319/dow-jones-100-year-historical-chart
If you started investing in 1965 and planned to retire in the early 1980's, you'd be in really bad shape. Oh, you want to start earlier? Try investing in 1915 and want to retire any time after 1930. There's a good chance that none of your original investments are even around anymore to profit from.
Oh, you started investing in 1942? Great! Sort of. Seven years later you're probably barely breaking even after a couple good years, but then it's up until the mid 60's when it's headed back down again. But you know that it'll go back up, since it did before, right? But you decide to finally retire in the mid 70's and you've barely doubled your money in 30 years. That might be a good return in the stock market world, but what if you had instead invested in more education for yourself or your family? Education is often better at increasing your income than stocks.
Oh, you want something more recent? Say you invested in 2000, you've seen the market drop several times and take years to recover the value. So in early 2020, you see it drop for 2 solid months and get out. After 20 years, you haven't even come close to doubling your money and lost the extra money when it recovered just a few months later. But if you happened to invest 10 years earlier, you've quadrupled your money, but still only if you're lucky and 1000 other factors didn't cause you to lose your investments.
But that's just looking at the average. You argue that some companies still made money and increased their stocks during the lean times. Sure, but the vast majority of them lost money and value, which is why the Average went down. Yes, you could have gotten lucky, but averages and probability are against you. Yes, some stock went up, but there's likely many that ceased to exist, which means your shares do, too.
"Oh, but I'd sell before it fell too far." The stock market doesn't reflect actual value of stocks, it reflects what people are willing to pay for the stocks. If you have a good stock broker, you might have won as much as you've lost. Even if you have a great stock broker, you're still losing sometimes, as luck fails eventually.
"Past performance is no guarantee of future results" is generally treated as a warning label: Don't assume an investment will continue to do well in the future simply because it's done well in the past. "Past performance is no guarantee of future results."
https://russellinvestments.com/us/blog/past-performance-no-guarantee-future-results
Also, when the market is falling, it shows that some people are still buying, presumably on the advice of their broker. So do you have a good one or bad one? And are those brokers/buyers expecting a rebound or simply waiting maybe years for things to recover so they can make big gains? Most likely, it's the average investor that's trying to not lose their shirt while selling and the big investor that can "weather the storm" while buying, as they have the money to risk.
Don't be fooled into thinking that this always works, because big investors are investing in failing companies, too. They lose plenty, which is not something the average investor can. These are the investors that can lose $10k and still make +$1M 5 years later because of that investment in the stock market drop.
Mutual funds and other diversity programs try to do some of this, depending on the risk factor of the program, but the less risky ones avoid this type of investing. They try to find stocks that are steadily climbing in value. If those stocks drop too far, they find another stock to climb with. Even this involves risk and it most definitely means continuously watching trends, not just sitting and assuming everything is going up.
I reply commented on one of my other Answers here with information about how even "high earning" diverse finds with a long history of gains can lose money (edited out info unrelated to this Question):
... the stock market is about the same as gambling. You might come out ahead some times, but most of the time not. If it was that easy to get even a 10% return, literally everyone would be doing it, and it wouldn't take high priced stock brokers to make gains. Eg: FXAIX is listed as having a 31.47% return in 2019, but a -53.75% growth rate this year. investopedia.com/articles/markets/10141 and seekingalpha.com/symbol/FXAIX/dividends/dividend-growth
...
Yes, those are two different stats, and I'm not a stock guy, but it seems as if a negative growth rate, you're losing money. And nearly 54% seems like a lot of loss. Also, looking at the graphs on the 2nd link, the returns go from $0.45 to $0.75, to less than a penny on a fairly frequent basis, meaning it's not very stable...
...
And really, you're looking at most stocks for 5% or less returns, when you need a minimum of 9% if you invest $1.1 million, which ignores taxes and fees... Also note that 5% is a good return, where many stocks and plenty of funds lose money.
Can a small family retire early with 1.2M + a part time job?
So again, when you enter the market and when you eventually get out are far better indicators of how good or bad you are doing in the stocks, and most of that is determined only after the fact.
Edit:
Dividends
Evidently people seem to think there's a massive amount of money to be made in dividends that I'm ignoring. One of the comments below talks about a 5.9% return reinvested. So lets look at that. According to the calculator linked, I put in Jan 1935 (which just happens to be 2 years after the Great Depression, so at an extremely low point in stocks (DIJA says 1945.74)) an end date of Dec 1975 (just after a decent boom (DIJA says 3996.95)), and adjusting for inflation, the "Total S&P 500 Return (Dividends Reinvested)" is 1345.624%, or a total of $134,562.40. The catch here is that only the wealthy had $10k back in 1935 to invest. The "average person" in the US was making $474 a year.
What if we don't adjust for inflation? Then we get a return of 5799.420% or $579,942. That's a nice, tidy sum, right?
Lets take a look at the credit card and Student Loan debt I said would be better to have paid off. Let's take the same $10k and use a compound interest rate calculator to see what kind of money we'd save over 40 years, compounding monthly, just like the other calculator did. But because it's a CC and Student Loans (or even personal loans) let's average the interest rate to 15%, since you can get CC's at up to 25% and student loans down to 3.7%, or so. And just like the other calculator didn't allow increasing or decreasing the original investment (since it didn't ask for it), I'm not going to put anything into the Transactions field. This comes out to $3,887,006.85, including the original $10k.
So, investing $10k for 40 years after the Great Depression could earn you up to $579,942 in total (dividends were reinvested), but having $10k debt at 15% for those same 40 years would cost you nearly 6.7 times as much at $3,887,006.85. The math of investing instead of paying off loans just doesn't work for me, since you are paying more for the loan than earning on the investment.