Pandas are one of the world’s most fascinating vegetarians. Their digestive systems evolved to process meat, yet they eat nothing but bamboo—all day, every day. A new study reveals how these animals survive on a diet that should kill them.

Giant pandas (Ailuropoda melanoleuca) are a type of bear, and they still retain a meat eater’s digestive system, with a simple stomach and a short small intestine. They don’t have a four-chambered stomach like a cow to digest plants efficiently, and a pure bamboo diet contains hardly any protein and a lot of indigestible fiber.

To understand how pandas subsist on such a diet, researchers radio-collared three male and three female pandas in the Qinling Mountains of China and observed what they ate in their natural habitats for 6 years. The team also analyzed the panda diet in depth by measuring the amounts of nitrogen, phosphorous, and calcium—the three most essential nutrients for mammals—in the plants they ate.

“There is strong evidence that animals try to forage as effectively as possible to meet their nutritional needs, mixing dietary items to provide a full complement of nutrients,” writes primatologist Jessica Rothman of the City University Of New York’s Hunter College, who was not involved in the study, in an e-mail. “In areas with only one edible plant, animals may try to consume different parts of the same food.”

That’s exactly what the pandas seem to be doing. The two bamboo species in Qinling, wood bamboo and arrow bamboo, grow at different elevations and sprout new shoots and leaves at different times of the year. The tracking collars revealed that during mating season in the spring, pandas fed on young wood bamboo shoots, which are rich in nitrogen and phosphorous. In June, the wood bamboo shoots had matured and contained fewer nutrients, so pandas migrated to higher elevations and started eating young arrow bamboo shoots. However, both species’ shoots had low calcium levels, which pushed pandas toward the next dietary shift in mid-July: young arrow bamboo leaves, which are rich in calcium.

This dietary juggling act appears to affect panda reproduction, the team reports online this month in Functional Ecology. Although the animals mate in the spring, they undergo “delayed implantation”—the embryo remains in a state of arrested development in the mother’s uterus until it attaches and resumes growth. The authors speculate that panda embryos continue development only after there is sufficient calcium in the diet.

In August, females return to the lower elevations and deliver tiny, pink panda babies. The adult mothers start eating young wood bamboo leaves, which have sufficient nutrients, including the calcium necessary for lactation. Pandas have the shortest gestation period among bears, about 2 to 3 months compared with 6 months in other species. They also have the smallest offspring—newborns weigh just 90 to 130 grams, whereas other bear cubs are a more brawny 300 to 400 grams. Their small size could be due to the nutrient limitations of their habitat, the authors say.

But even nutritional juggling may not allow pandas to survive the winter. Wood bamboo leaves age over this season, and their nutrient levels drop, causing high mortality among pandas. In fact, records from Qinling show that among 25 cases of dead or ill pandas over the past 37 years, more than half occurred in March and April, right after the hardships of winter.

The study helps explain how pandas survive on such a limited diet, says wildlife biologist Dajun Wang of Peking University in Beijing, who has worked on pandas in Qinling. But he says the animals may be getting nutrients from other places as well. “I have seen them scavenge from time to time,” he writes in an e-mail. “They may also get calcium and other nutrients from licking rocks.”