Online slot machines at licensed casinos have random number generators. These make sure the result of every spin is unpredictable. An independent tester also checks the RNG regularly to confirm the games are fair.