That doesn't mean that there are no risks. There are always risks but the math allows us to quantify those risks and make informed choices. Executing an effective strategy requires understanding the data, identifying an approach that fits your goals and then, most of all, the financial discipline to rigorously stick to the plan over many years despite emotional ups and downs (eg fear in downturns, exuberance in upswings).
Personally, I've been executing such a plan for decades now and I can assure you it feels nothing like a "casino" or gambling. Instead, it's downright boring. Once a year I make a predetermined algorithmic rebalance to the broad portfolio and otherwise I do nothing and don't even think about it. When the portfolio was way up a couple years ago, I didn't cash in any extra nor even 'celebrate'. Now that the portfolio is down this year, I'm not selling or thinking about cutting "losses." Why? Because they aren't losses unless I need to sell and I don't need to sell now because those prior "winnings" from a few years ago are more than enough to cover several more years of downturn if necessary. So far, the overall multi-decade results are substantially ahead of plan.