Many Americans spend billions each week playing the lottery, even though the chances of winning are incredibly slim. And that’s a shame. Because by spending a few dollars a week on the lottery, they’re sacrificing savings they could have put toward things like retirement or education. And if they play the lottery regularly, those few bucks can add up to thousands in forgone savings over their lifetimes.

The history of lotteries is not an easy one to tell. They were widely used in ancient times, from Nero’s infamous feigned lotteries to the casting of lots in the Bible for everything from a new king to who gets Jesus’ garments after his Crucifixion. Usually, though, they were organized to raise money for public works or to give away property or slaves. Then, starting in the seventeenth century, lotteries began to spread to America as English colonists brought them with them — and they did so despite strict Protestant proscriptions against gambling. In early America, lotteries became tangled up with the slave trade in ways that were often unpredictable. George Washington managed a Virginia-based lottery whose prizes included human beings, and a formerly enslaved man named Denmark Vesey won a South Carolina lottery and went on to foment a slave rebellion.

In Cohen’s telling, the modern lottery era began in the nineteen-sixties when growing awareness of the riches to be had in gambling collided with a crisis in state funding. As population growth, inflation, and the cost of the Vietnam War soared, it became difficult for states to balance their budgets without raising taxes or cutting services — which proved extremely unpopular with voters. For politicians confronting this dilemma, Cohen writes, the lottery seemed to be a miracle. It allowed them to make revenue appear magically out of thin air.

Lottery plays out much like other betting games, with bettors marking a series of numbers on a slip that is then collected and entered into a drawing for a prize. To be a success, the lottery must have rules that determine how frequently and how large the prizes should be. It must also have a system for recording the identities of bettors, their stakes, and the numbers or other symbols they mark. Then, a percentage of the pool must be deducted for costs and profits, leaving the rest available for the winners.

Eventually, Cohen writes, legalization advocates stopped arguing that a lottery would float most of a state’s budget. Instead, they started claiming that it would fund a single line item, invariably a popular and nonpartisan service — education, elder care, public parks, aid for veterans — and, by implication, that those who voted to legalize the lottery were voting to support that particular program. This narrow approach made campaigning easier, because it allowed legislators to claim that a vote for the lottery was not a vote for gambling or even for higher taxes. In this way, the lottery became the anti-tax option of choice for conservative and libertarian politicians alike.