The jackpot is triggered by a specific combination of symbols on the reels. When you pull the lever or push the button, the random number generator generates a mixture of symbols. If the given combination matches the jackpot combination, you win big time.
The biggest prizes are awarded in Mega Millions and Powerball. Each player picks a series of numbers that they hope will be randomly selected during the next drawing. The jackpot goes to the person (or people) who pick all six numbers correctly. The odds of doing that are shockingly low.