In the food world, salad’s like the kid who’s picked last in gym class. Why is it we’re more likely to prefer a less healthy option, like pizza or a bacon double cheeseburger? To be sure, some foods are cheaper, more convenient (especially in areas known as “food deserts”) and let’s be honest, tastier. But new research has discovered the decision to eat garbage isn’t as cut-and-dry as that. It turns out as you’re eyeing the organic produce, your brain is assessing the situation and making other plans, Terminator-style.

A new neuroimaging study published in the journal Psychological Science suggests our brain has an internal calorie counter that evaluates our food options and decides what to nosh on based on how many calories each food contains — and the more calories, the merrier. (Which could explain why my cardio workouts always seem to involve a chocolate bar clearance sighting.)

For the study, 29 healthy participants were asked to examine snapshots of 50 familiar foods. They rated how much they liked each food on a scale from 1 to 20 and estimated each food’s calorie count. Ironically, they bombed in the accuracy department, yet in a simulated auction setting were willing to pay more for the foods that were calorie-packed.The results from the participants’ brain scans found that as they were ogling the food pics, the activity in their ventromedial prefrontal cortex — which calculates the reward you’ll receive from eating the food and how quickly you’ll be rewarded — was heavily connected to the foods with higher calories. Meanwhile, how much they liked the food was connected to activity in the insula, an area of the brain linked to processing the sensory properties of food (how it tastes, smells, etc.).

We likely consider calories rewarding because we’ve adapted to doing so as part of our survival — and junk food didn’t exist during the caveman days. We learn to crave highly caloric food after being exposed to it, wrote Dr. Alain Dagher, neurologist at the Montreal Neurological Institute and Hospital and lead author of the study, in an email. “When we eat a food, the nutrients enter the blood stream and then the brain,” which takes note of the higher-calorie foods and adds them to its favorites menu.

“Based on how the food has made us feel in the past – happy, deserving, and even euphoric – we anticipate these feelings again in an almost drug-like way,” wrote Trudy Scott, certified nutritionist and author of The Antianxiety Food Solution in an email. This was fine for our ancestors, who may have found calories to be scarce or costly – but now, with the rise of synthetic this and processed that, this instinct is leading to oodles of health problems like high blood pressure, heart disease, and type 2 diabetes.It’s good to know that our food cravings aren’t just about a lack of self-control.