To call gambling a “game of chance” evokes fun, random luck and a sense of collective engagement. These playful connotations may be part of why almost 80 percent of American adults gamble at some point in their lifetime. When I ask my psychology students why they think people gamble, the most frequent suggestions are for pleasure, money or the thrill.

While these might be reasons why people gamble initially, psychologists don’t definitely know why, for some, gambling stops being an enjoyable diversion and becomes compulsive. What keeps people playing even when it stops being fun? Why stick with games people know are designed for them to lose? Are some people just more unlucky than the rest of us, or simply worse at calculating the odds?

As an addiction researcher for the past 15 years, I look to the brain to understand the hooks that make gambling so compelling. I’ve found that many are intentionally hidden in how the games are designed. And these hooks work on casual casino-goers just as well as they do on problem gamblers.

Uncertainty as its own reward in the brain

One of the hallmarks of gambling is its uncertainty – whether it’s the size of a jackpot or the probability of winning at all. And reward uncertainty plays a crucial role in gambling’s attraction.

Dopamine, the neurotransmitter the brain releases during enjoyable activities such as eating, sex and drugs, is also released during situations where the reward is uncertain. In fact dopamine release increases particularly during the moments leading up to a potential reward. This anticipation effect might explain why dopamine release parallels an individual’s levels of gambling “high” and the severity of his or her gambling addiction. It likely also plays a role in reinforcing the risk-taking behavior seen in gambling.

Studies have shown that the release of dopamine during gambling occurs in brain areas similar to those activated by taking drugs of abuse. In fact, similar to drugs, repeated exposure to gambling and uncertainty produces lasting changes in the human brain. These reward pathways, similar to those seen in individuals suffering from drug addiction, become hypersensitive. Animal studies suggest that these brain changes due to uncertainty can even enhance gamblers’ cravings and desire for addictive drugs.

Repeated exposure to gambling and uncertainty can even change how you respond to losing. Counterintuitively, in individuals with a gambling problem, losing money comes to trigger the rewarding release of dopamine almost to the same degree that winning does. As a result, in problem gamblers, losing sets off the urge to keep playing, rather than the disappointment that might prompt you to walk away, a phenomenon known as chasing losses.

Lights and sounds egg you on

But gambling is more than just winning and losing. It can be a whole immersive environment with an array of flashing lights and sounds. This is particularly true in a busy casino, but even a game or gambling app on a smartphone includes plenty of audio and visual frills to capture your attention.

But are they just frills? Studies suggest that these lights and sounds become more attractive and capable of triggering urges to play when they are paired with reward uncertainty. In particular, win-associated cues – such as jingles that vary in length and size as a function of jackpot size – both increase excitement and lead gamblers to overestimate how often they are winning. Crucially, they can also keep you gambling longer and encourage you to play faster.

Feeling like a winner while you’re losing

Since games of chance are set up so the house always has an advantage, a gambler wins infrequently at best. You might only rarely experience the lights and sounds that come along with hitting a true jackpot. However, the gaming industry may have devised a way to overcome that issue.

Over the last few decades, casinos and game manufacturers significantly upgraded slot machines, retiring the old mechanical arms and reels in favor of electronic versions known as electronic gaming machines. These new computerized games and online slots come with more attractive colorful lights and a variety of sounds. They also possess more reels, ushering in a new era of multi-line video slot machines.

Having multiple lines enables players to place a bunch of bets per spin, often up to 20 or more. Although each individual bet can be small, many players place the maximum number of bets on each spin. This strategy means a player can win on some lines while losing on others, netting less than the original wager. Even when you “win,” you don’t come out ahead, a phenomenon known as “losses disguised as wins.” Yet each win, even when it is a loss disguised as a win, comes with the lights and sounds of victory.

The result is that these multi-line slot machines produce more enjoyment and are highly preferred by players. Crucially, they tend to make gamblers overestimate how often they’re truly winning. The dramatic increase in the frequency of wins, whether real or fabricated, produces more arousal and activation of reward pathways in the brain, possibly accelerating the rate at which brain changes occur. Multi-line slots also seem to promote the development of “dark flow,” a trance-like state in which players get wholly absorbed in the game, sometimes for hours on end.

Almost: Near-miss effect and chasing your losses

The rise of electronic gambling machines also means that rather than being constrained by the physical arrangement of different possible outcomes on each reel, possible outcomes are programmed onto a set of virtual reels. Gaming designers can therefore stack the deck to make certain events occur more frequently than others.

This includes near-misses, where one of the reels stops just short of lining up for a jackpot. These near-miss almost-wins recruit areas of the brain that usually respond to wins, and increase one’s desire to play more, especially in problem gamblers.

This phenomenon is not confined to slot machines and casinos. Near-misses play an integral part in the addictive potential of smartphone games like the very popular “Candy Crush.”

Near-misses are more arousing than losses – despite being more frustrating and significantly less pleasant than missing by a longshot. But crucially, almost winning triggers a more substantial urge to play than even winning itself. Near-misses seem to be highly motivating and increase player commitment to a game, resulting in individuals playing longer than they intended. The size of the dopamine response to a near-miss in fact correlates with the severity of an individual’s gambling addiction.

Gambling and its games

When you engage in recreational gambling, you are not simply playing against the odds, but also battling an enemy trained in the art of deceit and subterfuge. Games of chance have a vested interest in hooking players for longer and letting them eventually walk away with the impression they did better than chance, fostering a false impression of skill.

For many people, these carefully designed outcomes enhance the satisfaction they get from gambling. It may remain easy for them to simply walk away when the chips run out.

But gambling isn’t only a lighthearted promise of a good time and a possible jackpot. Up to 2 percent of the U.S. population are problem gamblers, suffering from what’s recently been reclassified as gambling disorder.

It stands out as one of the few addictions that doesn’t involve consumption of a substance, such as a drug. Like other forms of addiction, gambling disorder is a solitary and isolating experience. It’s tied to growing anxiety, and problem gamblers are at greater risk of suicide.

For these more susceptible individuals, the game designers’ hooks start to seem more sinister. A solution to life’s problems always feels just one spin away.