Let's compare gambling and investing.
Gambling in casinos, lotteries, sports betting etc. =
- win-lose - one person wins, the other loses, money simply moves from one to the other;
- odds stacked against the player, and a significant chunk of the total bet of all players ends up in the hands of the house;
- very short-term, at most a matter of weeks till the payoff comes, feeding on desires for instant gratification;
- a fixed date and time, most often not of your choosing, when the game is decided;
- wide payoff gap between winning and losing, more win-all vs lose-all than a just-get-your-money-back situation
- skill doesn't count for much in determining success, it's mainly random chance and where skill can be useful, like sports betting, odds-makers remove most of that possibility.
The opposite is true of Investing.
First, buying stock means buying part ownership in companies providing products and services that are of real value in the real economy. By and large they are productive, grow and make profits and therefore there is a positive expected return to stocks. That does not mean they all make money all the time and that competition doesn't ever drive some right out of business but the overall odds are positive for gains that reflect a growing economy. Put another way, the stock market is not simply win-lose, it is more often win or greater win with some lose. The simplest and best way to achieve the benefit of overall market growth is to diversify by holding many companies in many sectors.
Second, there is lots of information available and skill can count a lot in successfully selecting the good companies and assessing reasonable prices for the shares. Skill, rather than luck, predominates.
Third, investment time lines are not fixed. No one forces an investor to sell shares and take a loss at the moment. If one's investments are down temporarily, it is possible to wait out market downturns. Stock market investment should not be short-term. To increase the odds in one's favour, the longer the period of investment, the better. When investing in equities, being able and ready to commit to leaving the money for ten years is a fairly safe rule. This chart from Assante Asset Management shows positive returns for every ten-year rolling period for major world equity indices since 1980.
The Bear-Bottoming Process chart image below from dshort.com shows how recovery eventually occurred from all the major recessions and bear markets since 1950, fluctuating around a trend line of long term economic growth.
At times it took very long for stocks to recover to previous peaks, the longest in the USA being from the 1929 crash to 1954 - 25 years later. That's why the diversity of a portfolio should extend beyond stocks to other asset classes, as discussed in previous post Asset Allocation, some of which will have positive returns when stocks do not. At the extreme, if you think we are in for a 1929-like crash, expect to die sooner than 25 years from now and want to spend all your money before dying, then stocks are not the best place to put money. As noted before in Setting Investment Objectives, the moment when funds are to be spent is a key consideration as to which type of investments - stocks or otherwise, to choose.
Gamble for long enough and you will almost surely lose everything but if you invest for long enough, you will almost surely not lose.