Whether it’s for units in a subsidized housing block or kindergarten placements at a local public school, people often use lotteries to determine who gets the goods and services they need. But there’s another type of lottery that dispenses big cash prizes, and it’s one of the more popular forms of gambling around: the financial lottery.

In this type of lottery, participants pay a fee for the opportunity to choose numbers that match those randomly spit out by a machine or are picked by an official. The winner receives a prize, usually ranging from a few dollars to millions of dollars. The term comes from the drawing of lots to distribute property or other rights, a practice that dates back centuries and was recorded in ancient documents including the Bible. In the United States, state governments conduct lotteries and use proceeds to fund education, roads, public works, and other social services.

The federal government doesn’t regulate state lotteries, giving them a virtual monopoly and allowing ticket sales in all states, the District of Columbia, Puerto Rico and Guam. As of 1998, the Council of State Governments reported that most lotteries were administered directly by a state’s legislative branch or an executive agency and that oversight of fraud and abuse rested with the attorney general’s office or state police departments.

Many lotteries promote themselves by teaming up with well-known celebrities and sports franchises to offer products as prizes. For example, New Jersey’s lotteries have offered Harley-Davidson motorcycles as top prizes in recent years. Many of these merchandising deals benefit both the company and the lotteries by creating brand awareness.

There’s no doubt that lottery players enjoy fantasizing about winning a fortune for a couple of bucks. But it’s also important to remember that the odds of winning are slim. That’s why it’s important to play within your budget and keep in mind that you shouldn’t see the purchase of a lottery ticket as part of your savings or investment plan.

For the financially disadvantaged, who make up a disproportionate share of lottery players, the temptation to spend money on lottery tickets can be especially difficult to resist. As a result, critics have argued that lotteries are a disguised tax on those who need to stick to their budget and cut unnecessary spending. But for most, the thrill of participating in a lottery is simply part of human nature. After all, there’s nothing wrong with a little bit of luck and instant gratification from time to time. Just don’t confuse it with a wise financial choice. Read more articles from NerdWallet’s Money & Markets columnists. You can follow them on Twitter or check out their other work on NerdWallet.