Online casinos are not a scam at all. They use the exact same technology as slots at a land casino.

Basically, how it works is that the casino has a selected payout percentage, which is usually determined based on the jurisdiction that they are licensed in. This will randomly pay out wins over 1000 credits. There will be winning streaks, and losing streaks. But over the course of 1000 credits, the payout is exact.