It happens when you least expect it—driving in the car, flipping through a magazine at your desk, catching up on the latest episode of “Jersey Shore.” Out of nowhere, it strikes. Boom.Enter, the Craving.That intense, I-want-no-I-NEED-sugar-fat-right-NOW feeling grips you like an iron maiden, peeling away the willpower that keeps your sweet tooth in check all day. But no matter how valiant your efforts or worthy your cause, eventually, you break.We’ve all caved into one craving or another, making a beeline for the fattiest, sweetest, most caloric food within reach. And then, naturally, in floods the guilt.What’s the Deal?Before you hang your head and curse your lack of willpower, new research shows that giving into the craving may not be due to a crack in our resolve, after all: We may be evolutionarily hardwired to crave high-caloric foods. In other words, you can blame our prehistoric ancestors (we’re looking at you, Lucy, for genetically predisposing us to seek out fatty foods to quell hunger).“In prehistory, calories were in intermittent supply and very essential for survival,” explains Susan B. Roberts, Ph.D., professor of nutrition at Tufts University and author of “The ‘I’ Diet” book and program. “So it makes sense to have a mechanism to ensure that we really love calories and are willing to work to get them!”In Fred Flintstone’s prehistoric era, high-caloric food was in high demand and in short supply. Unlike readily available, yet low-calorie plant-based foods, it took some doing to reign in a hefty dose of fat and calories, which usually came in the form of meat.QUIZ: What’s Your Eating Personality?So when good old Fred (or hey, Wilma, too) had a successful hunting party, the brain responded to the sudden caloric-upsurge by flooding the body with the feel-good chemicals dopamine and serotonin. This deluge of happy hormones created an almost Pavlovian effect, linking high-fat, high-caloric foods with rewarding feelings of happiness and contentment. A match was made.“Our earlier ancestors were hard-wired to search for sugar, fat and protein,” says Anthony Salerno, a marketing doctoral student who researches survival instincts at the University of Miami. “It was adaptive at that time because of their rarity, but fast forward to 2011 and it’s no longer the case because there’s food everywhere,” leaving us stranded somewhere between a 24-hour doughnut shop and McDonald’s ever-glowing arches.Our natural survival instinct forces us to compensate for a perceived lack of resources, even if one does not exist, according to Salerno’s research. “People make a deliberate decision to go with something more filling or higher in calories when they perceive that resources are scarce in a certain moment of time,” explains Salerno.COLUMN: All Foods Aren’t Created Equal, by Dr. Oz & Dr. RoizenBut it doesn’t take an impending famine to trigger these cues. Take the current dip in the stock market, suggests Salerno, or potential layoffs at the office. An unconscious (and sometimes conscious) fear of financial struggles could be enough to spark the survival instinct to chow down on high-calorie foods.“These thoughts can operate in the background, causing us to make fairly dramatic differences in what we choose to eat,” says Salerno.Once activated, this seek-food-and-eat-it mindset is hard—but not impossible—to quash. Take one of Salerno’s recent studies: After subjects were primed through word cues designed to indicate a potential lack of surrounding resources, they were offered the choice of a garden salad or cupcakes. In the beginning, nearly 73 percent of the group chose the more filling, higher calorie cupcakes.But when certain subjects were offered resources in the form of money before food, those who ate cupcakes dropped to 45 percent.While you may think that emotions or memories drive your cravings for your mom’s baked macaroni and cheese or grandma’s cheesy lasagna, it may be that our bodies are jonesing for these comfort foods at an even deeper, cellular level, according to new research published in The Journal of Clinical Investigation.MORE: The Science of Comfort FoodIn the study, researchers effectively removed the “joy” of eating from the equation—the delicious smells that remind you of your favorite home-cooked meal—by simply injecting a solution of fatty acids directly into the study participants’ stomachs. (Yikes!!Compared to those who were only given a saline solution, people with the mixture of fatty acids had a more positive reaction after listening to depressing music and looking at sad faces, showing that we may actually be biologically, not just psychologically, predisposed to crave high-calorie comfort foods when we’re down.How to Help YourselfBetween battling emotional, gut-like reactions to food and cravings at a molecular level, we seem to be left without an evolutionary leg to stand on. So do we have any hope of combating cravings?“It’s not a losing battle,” says Susan Albers, Ph.D., a psychologist at The Cleveland Clinic and author of “50 Ways to Soothe Yourself Without Food.” “You can rewire your brain. It’s about conditioning. We turn to food on autopilot, and we’re eating before we even realize it. When we [switch] it with something else, that becomes the default.”Unlike a true physical hunger, which develops over time, cravings come out of the blue and can be triggered by almost anything: stress, boredom, emotions or simply seeing or smelling a certain food, notes Albers. The key is to begin associating these cravings with another action, such as sipping tea or taking a walk.“It’s like substituting one habit for another habit,” said Brian Wansink, Ph.D. author of “Mindless Eating: Why We Eat More Than We Think.”Take your worries out on worry beads. Pick up some worry beads and keep them with you. Moving the beads back and forth between your fingers helps keeps hands busy and removes tension, suggests Albers.Take a whiff of scented oils. Scent has a powerful affect on our emotions. “Think of the smell of grass or the cologne of someone you love—scents travel directly to the emotional center of the brain,” says Albers, who cites a study where graduate school nurses who sniffed lavender reduced test anxiety and pulse rate.Chew gum. Keeping your mouth busy by chomping on gum or tea tree toothpicks may help reduce stress eating and they’re calorie-free, notes Albers.Sip black tea. Curling up to a cup of black tea has been clinically proven to reduce cortisol levels by nearly 50 percent, according to a study in Psychopharmacology. What’s more, the sheer act of taking a moment to drink something warm can have the calming effect necessary to combat a craving, according to Albers.Write in your journal. Eating to tame your emotions? Try putting pen to paper instead of fork to mouth. “Research shows that journaling is an effective tool for reducing stress and anxiety,” says Albers.Rub yourself the right way. Try this self-massage trick from Albers to tame tension, which can induce cravings: Place a tennis ball under your foot and roll it around. Or place the ball on a wall and press your back against it, rolling the ball back and forth between your shoulder blades. “According to reflexology studies, massage stimulates feel good neurotransmitters,” she says.Check back at our Eat Pretty homepage for tips on how to overcome your eating issues, and take our Eat Pretty Quiz to find out how you’re doing.