It all comes down to the precise moment that you pull that handle or push that 'Spin' button (i.e. Like the roulette wheel, where every play is completely random and independent, one pull of a slot handle is completely random and completely independent of the previous or next pull. The above is important because it de-bunks some long-held assumptions about slot machines. You are simply telling the machine to display the reel positions that correspond to the last set of random numbers that were generated.
When you pull the handle or push the 'Spin' button you aren't really initiating anything except the spinning of the reels which is merely for show.
These random numbers correspond to positions on each of the reels in the machine. Slot machines contain a 'random number generator' (RNG) micro-computer that constantly (even while the machine is not being used) spits out numbers.