Trading differs from gambling because any edge is measurable, costs are partly under your control and the time horizon is your choice, but a trader with no stop, no size rule and no records is gambling.
The fair starting point: both involve real risk
Neither activity lets you skip risk by wishing it away. A leveraged position can lose money quickly, and the sum you put in can go. Anyone who softens that in order to sell you a course or a bot is not answering your question, they are avoiding it. The useful comparison is not safe against unsafe; it is controllable against uncontrollable.
Four differences that actually matter
The gap between the two activities shows up in four places. Each one is worth examining in your own trading rather than in the abstract.
The same four points, stated as a question to ask about your own trading.
Expected edge
A bookmaker sets odds so the average bettor loses over time; a trader can study, test and record whether a specific approach has a positive result over many trades, and can also discover that it has none