This discovery explains some puzzling parts of panda biology. The panda’s ancestors switched to a vegetarian diet more than 2 million years ago. In that time, the panda has evolved stronger jaws for chewing tough, fibrous mouthfuls, and one of its wristbones has become a false thumb, for gripping bamboo stems. But despite these superficial hardware changes, it still has a meat eater’s digestive system.

Plant-eating mammals almost always have enlarged, elongated guts to slow the passage of food, and to give their inner bacteria more time to digest their meals. The panda, however, has the short, vanilla gut of a carnivore. Even its gut microbes are closer to a bear’s than, say, a cow’s or deer’s. Nie and Wei’s study makes sense of this paradoxical combination of traits. The giant panda has the plumbing of a half-committed herbivore because it has the diet of a closet carnivore.

Read: Pandas bounce back in spite of their critics

The team used tracking collars to follow pandas in China’s Foping National Nature Reserve, which harbors the highest density of these bears in the world. The pandas, it turned out, migrate over long distances to exploit the shoots and leaves of two bamboo species, which grow at different altitudes. Every year, the bears cycle from low-growing leaves, to low-growing shoots, to high-growing shoots, to high-growing leaves, and back again. The team analyzed these varied mouthfuls and determined that the pandas’ decisions seem largely motivated by protein. They’re always selecting the species and tissues that offer the most protein and the least fiber.

Their selective tastes mean that at least 50 percent of their energy comes from protein, while just 39 percent comes from carbohydrates, and 13 percent from fat. That’s comparable to feral cats and wolves, which also get half their energy from protein. And it’s starkly different from other plant-eating mammals, which typically get 20 percent of their energy from protein.

Panda poop, which the team also collected and analyzed, told the same story. So did panda milk. Nutritionally, it stands apart from most herbivore milk, and falls in with typical carnivore milk.

This suggests that the move from meat to plants might have been easier for ancestral pandas than commonly assumed. By simply choosing parts of plants that are richer in protein, they could switch to vegetarianism without needing to radically overhaul their bodies. “If you’re going to switch to a specific plant, bamboo isn’t too bad, as it does have respectable plant protein levels, as well as a swath of different vitamins,” says Garret Suen of the University of Wisconsin at Madison.

Read: The life, times, and departure of Bao Bao the panda

These results should help to counter the tiresome myth that pandas are evolutionary dead ends: lazy, poorly adapted creatures that eat deficient diets, are inept at sex, and should be allowed to go extinct. Nonsense. Pandas have beautifully adapted to eat an extremely plentiful food source—bamboo—and they go to great, careful lengths to get exactly the right balance of nutrients.