Actually distinguishing between gambling and trading is quite easy, but most people have been influenced by the profits offered, so instead of learning about trading properly, they get caught up in gambling. Perhaps they think that trading is just buying and selling, but what they buy is not based on understanding, but merely guesswork. The most important basic concept in trading is knowing what you are buying/selling.
Many traders enter the market with the idea of making quick profits, and they are mainly influenced by seeing screenshots of other people's big profits. So they develop a mindset that trading is very easy, and that it is possible to make big profits without any trading skills.
And basically, all these traders start gambling when they start trading and eventually face big losses. Basically, those who have no trading knowledge or trading skills consider trading to be like gambling. They think that it is possible to make big profits from trading only if they can buy and sell. But the reality is very cruel.