Philip Donoghue doesn’t eat a lot of shrimp anymore. It’s hard to blame him. As a paleobiologist at the University of Bristol in the United Kingdom, he’s been studying how brine shrimp (Artemia) decay in various environments—one of the “less sexy sides” of science, he laughs. But thanks to Donoghue’s work, this humble crustacean may help solve a major evolutionary mystery: why some animals are better preserved than others in the fossil record.

“There’s a bunch of things that they’ve done in this study that haven’t been done before,” says Greg Edgecombe, a paleontologist at the Natural History Museum in London who was not involved with the work.

The overwhelming majority of organisms will never fossilize. Preservation of an animal’s anatomy in rocks is a rare event requiring a strict set of geologic and chemical conditions. Fossilized soft tissues like skin or muscle are even rarer, as they decay very quickly beyond recognition before mineralization occurs. It would be tempting to assume that microbes—the great mediators of rot and recycling—would be a natural enemy to high-quality fossils, but Donoghue’s time spent watching shrimp waste away seems to hint at exactly the opposite.

Brine shrimp are translucent, allowing the researchers to noninvasively observe how bacteria fill the body cavity after death. They saw that naturally occurring gut microbes quickly fill the entire digestive tract after death, sometimes within as few as 2 hours. Eventually the buildup of bacteria and their waste products ruptures the gut, and the microbes spill out across the rest of the shrimp’s internal structures and begin digesting them. If conditions are favorable, the microbes arrange themselves into an organized layer known as a biofilm, which can coat surfaces in a crystalline mesh rich in phosphates or calcium. These crystal structures serve as a cast mold of the animals’ internal anatomy and survive long after all the soft tissue has been eaten by the bacteria. The researchers believe it’s these structures, left behind by the biofilm, that are actually being preserved in the rare fossils that contain soft tissue.

But it’s not quite that simple: Even if bacteria build up in the gut and spread to the rest of the body cavity, they don’t usually arrive in time to preserve the tissue structure. Under most conditions, the cells outside the gut begin to rupture and break down before the microbes can escape the digestive tract, especially if bacteria from the external environment are present to speed up the decay process. Donohue’s team found, however, that very low oxygen conditions—such as when a shrimp carcass is buried in sediment at the bottom of the ocean—can slow the natural decay enough to give the bacteria time to make their fossil template. Other research has demonstrated that exceptional fossils tend to form in low oxygen environments, and Donoghue’s shrimp observations would seem to agree.

Donoghue’s team further bolstered preservation by adding antibiotics to the environment to slow deterioration from foreign bacteria. Microbes are thus something of a double-edged sword—facilitating both decay and preservation. “There’s this window we have for the loss of anatomy because of microbial process, yet on the other hand there’s the essential role they play in preservation—a sweet spot,” Edgecombe says.

The results, published online today in the Proceedings of the Royal Society B, could also help explain why the most common soft tissue preserved in fossils tends to be from the gut. Because the bacteria originate there, they have the best chance of forming a biofilm before the gut’s cellular structure breaks down too much. To capture an imprint of other body tissues, the gut must rupture quickly and conditions must be low in oxygen.

Edgecombe suggests that this could explain why almost no fossils larger than 2 mm long show much exceptional preservation; there simply isn’t enough time for the gut bacteria to do their work before the animals decompose. The researchers also point out that animals with true “through-guts”—ones that contain both a mouth and an anus—are much more likely to leave behind high-quality fossils than animals like corals and jellyfish, which eat and excrete through the same hole and are home to far fewer bacteria. The evolution of the anus appears to have given rise to a more complex microbiome and, thus, that “definitely increases your chances” of leaving behind an exceptional fossil, Donoghue says.