We all know at least one: That friend who complains incessantly about his fickle girlfriend, and yet keeps going back to her, even though most of the time she doesn’t treat him well. It’s frustrating for his friends, who must wonder if their buddy, despite his irritation at his partner, actually likes to suffer. But science might have a different explanation.

Richard A. Friedman, a professor of clinical psychiatry and the director of the Psychopharmacology Clinic at the Weill Cornell Medical College, wrote in the New York Times in 2012 that the reason a person returns to an unpredictable partner again and again isn’t because of “an unconscious motive for suffering” but rather because of “a quirk of the brain’s reward circuit, a primitive neural network buried deep in our brains that is exquisitely sensitive to various rewards, like sex, money, and food. This kind of amorous attachment is like gambling—except that the currency is affection and sex. The key is that the reward is unanticipated, which makes it particularly powerful and alluring to our brains.”

Tainted Love

To make his point, Friedman looks at the results of a study conducted by psychiatrist Gregory Berns, who analyzed what happens in the brain when rewards are predicted and unpredicted. Berns placed his subjects in an M.R.I. and watched their brain activity as he administered the rewards—fruit juice and water—first at random intervals, and then every 10 seconds. Berns found that when the reward was unexpected, there was greater activity in the brain’s reward circuit.

Much like the juice in Berns’s experiment, love and attraction activate the brain’s reward circuit, which, when stimulated, releases dopamine—a naturally occurring chemical that causes a sense of pleasure. This part of the brain has evolved to help us recognize rewards that are critical to our survival. “Unlike predictable stimuli, unanticipated stimuli can tell us things about the world that we don’t yet know,” Friedman writes. “And because they serve as a signal that a big reward might be close by, it is advantageous that novel stimuli command our attention.” So when that emotionally distant boyfriend is suddenly doting, the reward circuit starts firing, producing feelings of pleasure that make you want to stick around. And in all likelihood, you’re not consciously aware that that’s what’s happening.

Berns’s study also found that there was almost no connection between his subjects’ stated preferences and what their brain activity showed. “This suggests that our reward pathways may not only be activated without our recognition, but perhaps even in ways that are contrary to what we think we prefer,” Friedman says.

So the next time your friend complains about his girlfriend’s behavior, try to be sympathetic—it's not that he likes to suffer. Most likely, it's his brain playing tricks on him.