New study shows that mammals that sleep more have more immune cells and fewer parasites.

Why do we sleep? An international team of researchers recently published evidence that slumber may have evolved to protect animals from dis­ease. They examined sleep patterns of more than 30 mammalian species—including hedgehogs, baboons, seals, and elephants—along with the strength of their immune systems and levels of parasite infection. Some animals, such as giraffes, doze for just a few hours a day; others, such as armadillos, snooze for 20 hours.

The study found that animals that sleep the longest had six times as many immune cells as those that take short siestas. Additionally, critters catching the fewest z’s had 24 times as many parasites as the best-rested species. “Maintaining the immune system may be the reason sleep has evolved,” says lead researcher Brian Preston, an evolutionary ecologist at the Max Planck Institute for Evolutionary Anthropology in Germany.

Other scientists note that boosting the body’s defenses is just one of many vital functions of sleep. It also allows the brain to reorganize connections between neurons, consolidate memories, and synthesize proteins and cholesterols that are important in tissue repair, says Allan Pack, director of the University of Pennsylvania Center for Sleep.

Another new study bolsters the link between sleep and immune function in humans. Among 153 people voluntarily infected with a cold virus, those who averaged less than seven hours of sleep each night were nearly three times more likely to get sick than those with eight hours or more. “We’ve barely scratched the surface when it comes to understanding the health implications of sleep,” Preston says, “but it’s clear we should all get a good night’s rest.”