Across the country, billions are spent annually on lottery tickets. While some people play for fun, others have come to the conclusion that winning the lottery is their last or only chance at a better life. But how do lotteries really work? The answer might surprise you.

Until recently, most state lotteries were much like traditional raffles. People pay a dollar, select groups of numbers, or have machines randomly spit them out, and win prizes if enough of their selections match those of the other players. Revenues generally expand dramatically when a new lottery first opens, then plateau and eventually begin to decline as the novelty wears off. To maintain revenues, the lotteries must constantly introduce new games.

Many of these innovations are designed to increase the odds of winning, which are usually low (on the order of 1 in 4) compared to the size of the prize pool. For example, a lottery might offer a larger prize to the winner of a group of numbers that include a special sequence such as birthdays or ages, or it might allow players to select Quick Picks, which are generated by computer programs with numbers drawn from a large population set.

These strategies have some merit, but many of them are based on unproven assumptions about how people choose their numbers. Often, people choose their own numbers, based on things such as birthdays and other personal characteristics, or they follow patterns that are more likely to be repeated (for example, picking sequential numbers such as 1-2-3-4). In fact, selecting such numbers is probably one of the worst choices you can make, according to Harvard statistics professor Mark Glickman.

The casting of lots for making decisions and determining fates has a long history—it’s even mentioned in the Bible. More recently, it’s been used for material gain: The lottery has been a popular way to finance public works projects such as roads and wharves, and it has provided the financing for private ventures such as colleges and churches. In colonial America, lotteries helped finance the establishment of the Jamestown and Virginia colonies as well as the construction of Harvard and Yale.

Modern-day lotteries are a relatively recent invention, but they have grown rapidly since New Hampshire introduced the first state lottery in 1964. Most states now have a lottery, and many more are considering it. Lotteries have broad public support and are a vital source of funding for state government. But they also have important constituencies: convenience store owners who benefit from the high volume of sales; lottery suppliers, whose employees contribute heavily to state political campaigns; teachers in states where lottery proceeds are earmarked for education; and state legislators, who grow accustomed to the extra money. These interests are sometimes at cross-purposes, with some groups being favored by the lottery and others denigrated. This is a problem that is unlikely to go away soon. In the meantime, it is critical to understand how lotteries work.