People say “Life’s a lottery” to mean that luck is what determines your life path. But the term’s true meaning is more nuanced.

A lottery is any contest in which winners are chosen at random. This can be as simple as choosing a number from a hat or, in more modern applications, as complex as a state-sponsored contest in which players buy tickets for a chance to win big bucks.

Lotteries are rooted in history. The oldest is the Dutch state-run Staatsloterij, which dates back to 1726. It was once common for governments and charities to organize them in order to raise money for a variety of public uses, from poor relief to wars. The concept was particularly popular in Europe during the 16th and 17th centuries, when it helped finance a number of major projects, including building the first European railway.

Nowadays, 44 states and the District of Columbia offer lotteries; Alabama, Alaska, Hawaii, Mississippi, Utah, and Nevada do not. Some of these states have religious objections; others do not want to compete with gambling revenue; and still others find no need for it, as they already have ample sources of tax dollars.

Lotteries are not always a good investment. Purchasing a ticket or two might add up to thousands of dollars in foregone savings over the long haul, especially when people turn this habit into an addiction. Yet many people feel compelled to buy lottery tickets as a way of increasing their odds of winning the jackpot, even though they know that the likelihood of doing so is very slim.