Lottery is an enormously popular pastime in the United States and around the world, with Americans spending billions on tickets every year. But lottery has a dark side: it’s not just about winning the jackpot, and many of the biggest winners—and losers—are low-income people or minorities. In fact, many studies have shown that lottery play is disproportionately concentrated in poor neighborhoods and among people with gambling addictions. And for those who haven’t gotten lucky, lottery play is often a hidden tax on people with little income to spare.

Most state lotteries operate as a form of public-private partnership, with private businesses promoting and selling the games while the state provides prizes and regulates the industry. However, some state-run lotteries also raise money for public projects by collecting taxes on ticket sales, a practice that has drawn criticism from critics who say it amounts to a disguised tax on low-income and minority communities. The vast majority of lottery revenue, about 50%-60%, goes into the prize pot. The rest is divvied up between administrative and vendor costs and toward projects each state designates.

The idea of winning a large amount of money by chance is as old as civilization itself. The earliest known traces of such a competition come from keno slips from the Chinese Han dynasty, dating from 205 to 187 BC. But the modern lottery is much more sophisticated, with machines that randomly select numbered numbers and award prizes to those who match them. The first lotteries were purely charitable, but in the 17th century the British government began to promote them as a source of “painless” tax revenue. The same rationale has been used in the United States, where state-sponsored lotteries have raised billions for everything from paving streets to building schools and churches.

While lotteries are great for states, which get a big influx of cash from both ticket sales and winners, they aren’t without their problems. The most obvious issue is that a lottery’s prizes—which can be awarded as lump sums or in an annuity, allowing the winner to receive a payment each year for 30 years—are usually less than what you would have received by investing that money yourself. Then there are the taxes, which can take a huge chunk of your winnings.

And finally, there’s the problem of fairness. While critics of lotteries point out that they’re a form of hidden taxation, supporters argue that the benefits outweigh the costs, and that lottery players are willing to pay for the opportunity to win a large sum. But a study published this year in the journal Social Choice and Welfare found that, when it comes to lottery prizes, most people do not make decisions based on expected value maximization. Instead, they buy tickets for entertainment and fantasy value or because they believe that winning will make them happier. This makes it impossible for lottery purchases to be justified by the tenets of expected utility maximization.