It’s spring. A female hoopoe—a bird that looks like a pickaxe painted in a tiger’s colours—lays her eggs in a hole within a tree. The eggs come out milky blue, but they soon change colour to a mucky brown. That’s not just because the nests are dirty, as Wikipedia currently claims. It’s also because of a liquid that the female produces.

Look under the tail feathers of any bird and you’ll find the uropygial gland, or preen gland. It secretes oils and waxes that birds use to clean and waterproof their feathers. But during breeding season, a female hoopoe’s uropygial gland becomes exceptionally large, and it makes a weird dark brown fluid that smells of rotting meat. This is the stuff that discolours the eggs.

The nature of this pungent secretion became clearer a decade ago, when scientists injected the hoopoe’s gland with antibiotics. Suddenly, it produced fluids that were similar to those made by other birds—lighter in colour, thinner in consistency, and weaker in smell. The gland turned out to be full of bacteria—mostly Enterococcus, but other species too.

Manuel Martin-Vivaldi and Juan Soler from the University of Granada have been studying the hoopoe’s bacteria for many years. They found that the microbes produce powerful antibiotics, and that hoopoes uses these chemicals to keep feather-eating bacteria from destroying its pristine plumes.

Now, they’ve found evidence that these birds use the same bacteria to protect their young before they’re even born. By filming nesting females, they confirmed that the birds actively paint their eggs with their uropygial secretions.

That’s unusual in itself: bird eggs usually have smooth shells, and preening oils wouldn’t normally stick to them. But when Martin-Vivaldi and Soler looked at freshly laid hoopoe eggs under a powerful microscope, they found a multitude of tiny pits. These are new—no one has ever seen anything like them on bird eggs before. By the time the chicks hatch, almost 90 percent of these pits have been filled with a doughy material that’s loaded with Enterococcus bacteria.

View Images Left: Pits in a hoopoe’s eggshell. Right: Close up of the pits, with bacteria lining them.

It’s the female who fills the pits. When Martin-Vivaldi and Soler stuck catheters into the hoopoes’ uropygial glands to stop them from reaching their own secretions, the birds couldn’t fill the pits in their eggs, which ended up with fewer bacteria on their surfaces. The eggs, however, had more bacteria inside them. It seems that the microbes in the pits, and the antibiotics they produce, act as a living shield. They stop harmful bacteria from colonising the eggs, and from travelling through pores in the shell to reach the chicks inside.

How does that benefit the chicks? Here, the researchers’ results become a bit more ambiguous. They found that normally, when females had more bacteria in their glands, their eggs had more bacteria in their pits and were more likely to hatch. When the females couldn’t reach their glands, these correlations disappeared. However, the two groups of females—the normal ones and those that couldn’t reach their glands—were just as likely to raise successfully hatching eggs.

The team think that if the gland bacteria really are protecting the chicks, it might take a larger study to detect any benefits. It’s possible that these bacteria only matter depending on the levels of other disease-causing microbes in the hoopoes’ nests. It’s also possible that harmful microbes that manage to travel into the eggs doesn’t change the odds that the chicks will hatch, but affects them later in life.

For now, we know that the hoopoes are painting their eggs in bacteria. Why? That’s still not fully clear. And why are hoopoes the only birds that have these pits on their eggs? Martin-Vivaldi and Soler suspect that it’s because of their unusually dirty nests.

Hoopoe nestlings can defend themselves by squirting streams of faeces at intruders and, unlike other birds, they don’t clean their waste from their nests. Their slovenliness might save their lives but it also comes with a high risk of infection. Perhaps they have evolved to cope with this extra risk by forming partnerships with defensive microbes, and laying eggs that are full of bacterial condos.

Hoopoes might be the only birds with such structures, but they’re far from the only animals with them. Leafcutter ants keep Streptomyces bacteria in special chambers on their bodies that kill parasitic fungi. Rove beetles carry Pseudomonas bacteria that make pederin—a toxin that deters spiders and can even irritate human skin. We typically think of bacteria as ‘germs’ that cause illness. They’re just as likely to be guardians that protect us from disease.