You’ve probably heard that yo-yo dieting can backfire. Now we have some idea why: Scientists say that intense food restriction teaches the body to hold on to any calories and fat it can get. The researchers published their findings in the journal Evolution, Medicine, and Public Health.

There are oodles of diets out there, each promising that it alone holds the secret to dropping pounds and keeping them off forever. But almost all these diets are short-term strategies. The weight we lose almost always comes creeping back in as soon as we go back to eating normally.

It’s something of an evolutionary puzzle. If carrying excess weight is physiologically inefficient—that is, it can be taxing for the body—why would our bodies work to regain what we’ve lost?

To find out, two British researchers looked in an unexpected direction: math. Animal behavior scientist Andrew Higginson of the University of Exeter teamed up with University of Exeter mathematician John McNamara to create a mathematical simulation of yo-yo dieting and its effects. Using what they knew about the behavior and physiology of existing animals, including humans, Higginson and McNamara created a hypothetical animal. They set it in a hypothetical natural world that followed the same patterns as our own. The animal had to eat to live, and being active used up energy. The animal’s food supply also fluctuated, as it does for real animals in real habitats. The researchers’ question was this: Would those fluctuations produce long-term changes in the animal’s body?

They certainly did. The simulation results showed that a body in inconsistent conditions like those in which our ancestors evolved would benefit from retaining any fat it could find in times of abundance. The results also suggested that the artificial scarcity created by dieting is a real trigger for this self-protective weight gain. According to the team’s results, on-again, off-again dieters are more likely to put on weight than people who never diet at all. And while this fact may be frustrating, the authors say, it’s actually a sign of a healthy body.

"The best thing for weight loss is to take it steady,” Higginson said in a statement. “Our work suggests that eating only slightly less than you should, all the time, and doing physical exercise is much more likely to help you reach a healthy weight than going on low-calorie diets."

But please remember: You're wonderful just the way you are.