The short answer is that slots are programmed for a target percentage in the same way table games are: Odds of the game are set so they will naturally lead to an expected payback percentage.
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.