When you press the spin button on a slot game, the most important action happens instantly—long before the reels on your screen stop moving. The outcome of every single spin is determined the moment the request is sent to the server. The spinning reels, flashing lights, and sound effects are simply an animated presentation of a result that has already been decided.
This is made possible by the Random Number Generator (RNG). The RNG is a sophisticated piece of software that generates a continuous stream of random numbers every millisecond. When you click spin, the game picks the current number from that stream and maps it to a specific combination of symbols on the reels. Because these numbers are generated randomly, every spin is an independent event. This means that the result of your last spin has absolutely no influence on the result of your next one; the game does not "remember" wins or losses.