The lottery is a form of gambling that allows people to win money based on random chance. It is a popular way to raise funds for a variety of projects and causes, including education, public works, and other community development efforts. Some states even use it to provide social services and reduce property taxes. While the idea of winning a lottery jackpot has long been a part of popular culture, the modern lottery is relatively recent. The first state-run lotteries were established in the United States during the immediate post-World War II period. At that time, the idea was that lotteries would help governments expand their range of services without imposing particularly onerous taxes on middle-class and working class citizens.

But in actual practice, lottery revenue has rarely been enough to cover the cost of running a government and providing basic services for all its citizens. It’s also been a major source of income for a small minority of very rich individuals. This disparity has fueled growing anger over the role of the lottery in American society.

In the past, lotteries have been used to fund everything from municipal repairs in Rome and a city’s share of a national treasure known as the Monastery of the Sacred Heart in Bruges, Belgium, to paying off debts in New York City. They have also helped to spread English culture to the colonies during the era of colonial America, despite strict Protestant prohibitions against gambling. Some of the first church buildings in the United States were built with lottery funds, as were many of the country’s finest universities.

Today, 44 states and the District of Columbia run lotteries. The six states that don’t—Alabama, Alaska, Hawaii, Mississippi, Utah, and Nevada—don’t because of religious concerns; because they already have other ways to raise money for their governments; or because they want to avoid the perception of promoting gambling.

The lottery is a business, and businesses are in the business of keeping their customers coming back. That is why every detail about a lottery, from the design of its ticket to the math behind its odds, is carefully calibrated to make people keep playing. It is no more morally egregious than the tactics used by tobacco companies or video-game makers. The only difference is that it’s done with the approval of state government. For more articles like this, visit NerdWallet.