The most important thing to understand about online slots is that the visual reels you see spinning on your screen are purely for entertainment. In reality, the outcome of every spin is decided the exact millisecond you press the "Spin" button.
This is handled by a system called the Random Number Generator (RNG). The RNG is a sophisticated piece of software that generates thousands of random sequences every second. When you click, the game simply picks the most recent number generated and matches it to a result on the virtual reel strip. Because these numbers are entirely random, every single spin is an independent event. This means the game does not "remember" if you just won or lost, and there is no such thing as a machine being "due" for a payout based on previous spins.