Restless sleepers often find themselves magnetically drawn to the fridge, and science may finally understand why: Two recent studies suggest that most people are wired to succumb to the temptations of junk food like pizza and candy when they don't get enough sleep. Here's what you should know:

How were these studies conducted?
In one experiment, researcher Marie-Pierre St-Onge of the New York Obesity Research Center had 25 participants spend five nights in a lab. On some nights, they were allowed to sleep for nine hours; on others, they only got four. Subjects were then hooked up to a brain scanner and shown pictures of food. In subjects who'd been given only four hours of sleep, the brain's "reward center" reacted more noticeably when they looked at junk food such as donuts and pizza vs. healthy fare like veggies and fruits. The light sleepers' brains were also noticeably more responsive to unhealthy food than those of people who got a full nine hours of sleep. "If you're trying to control your weight, being sleep-deprived is not good for you," St-Onge tells My Health News Daily.

What about the other study?
Researchers from the University of California, Berkeley used a similar methodology: Sixteen subjects either got a full night's sleep or went a full 24 hours without shut-eye. They were then hooked up to an MRI scanner and shown pictures of food, and asked to rate their desire for each snack. Once again, sleepy subjects consistently gravitated towards unhealthy snacks, and MRI images showed impaired activity in areas of the brain associated with complex decision-making.

Why are sleepy people drawn to junk food?
When tired, "the brain can no longer convince itself that a healthy food is the right choice due to health benefits, and instead focuses on taste," says Susan E. Matthews at My Health News Daily. It's all "relative to cognitive control," says St-Onge. "Your guard is somewhat down when you're tired." Even when you know you shouldn't order an extra slice of pizza, "when you're tired you might just decide to go for it." And evolution may play a role. When you're fatigued, "your body would want calorie-dense foods that give you quick energy," says dietician Samantha Heller. "In an evolutionary sense," eating such foods would give you a short-term competitive advantage.

So, yet again, the answer is getting more sleep?
Yet again. There's a "clear take-home message" for people who want to make smarter eating choices, says Audrey Yoo at TIME: "Get plenty of sleep — at least seven to eight hours — every night." Your waistline will thank you.

Sources: HealthDay, My Health News Daily, TIME