The body of an ant generates formic acid, which is used to fight off predators and defend the nest. The acid itself is one of the simplest organic acids around. It is produced in a special abdominal gland, and this feature is found across numerous ant species.

Entomologists used to believe that the acid had a purely combat role, when the ants had to defend themselves or attack other insects. However, when observing their behavior, researchers noticed that ants would groom their abdomen after eating or drinking water, and they soon found out that they were ingesting the formic acid. Since the behavior was performed after drinking water as well as after eating, the researchers came to the conclusion that it was not linked to digestion.

After several experiments, scientists concluded that the ants perform this behavior to ingest formic acid and disinfect their stomachs. The ants were fed food samples that were laced with pathogenic bacteria, and if they ingested the acid, their chances of survival increased dramatically. The behavior also helps on a collective level. Ants often share food by regurgitating it and giving it to a neighbor. If the food has already been decontaminated, the odds of colony-wide disease spread decreased as well.

This filter mechanism explains why ants have such low levels of harmful bacteria in their digestive tracts. The only microbes that make it through are those that are resistant to acid. Ants are one of the few species that have a highly acidic stomach, along with humans and a handful of other vertebrates. And while our acid is produced internally, the effects are virtually the same.

If you’ve ever wondered how ants manage to avoid pandemics that would wipe colonies with millions of members, now you know. This behavior is likely just one of many that is designed to destroy or neutralize pathogens, but it is nonetheless very interesting to see how ants have evolved a separate use for what is essentially a defensive or offensive bodily function. Or perhaps, the formic acid was first evolved as a defense against bacteria, and then later used in combat. It’s also interesting that formic acid is found in bee stings, so there seems to be a connection between insects that live in large colonies and the use of formic acid for defensive purposes.