For those who don't quite understand the definitions of gambling and trading, it's natural that there are still many who misunderstand the equation between trading and gambling. Even though these two things are different as you said.
Gambling is just guessing and testing your luck by betting on something and our bets have no impact on that something. But trading means that we are directly involved in the market and our participation is also a driver in the market itself.
For many new traders, trading is just gambling because both gives them the opportunity to get rich. For me, capital management ability is not a reliable criterion to distinguish between trading and gambling, because an experienced gambler will also manage capital really well when participating in gambling.
I think the most important criterion we can use to distinguish them is the ability to make judgments: trading is conducted based on trading history, market data and tools that the trader can use to make possible scenarios for price fluctuations, then decide and manage orders. Meanwhile, gambling does not give any suggestions to players based on past data, or the dice have no memory. Most of the results will have the same probability, outside the player's efforts. All the player can do is manage capital and stop when necessary.
I myself never touch gambling, I want to focus on trading and control my investment carefully with my personal ability, not just relying on probability.