These small insects immune to caffeine are the worst enemies of your coffee.

You’ve probably never heard of it, but the coffee berry borer (Hypothenemus hampei) is your coffee’s worst enemy. This small insect, usually no more than two millimeters long, which burrows into coffee beans to live and reproduce, has become the world’s leading coffee pest, Wikipedia says.

As a result, says The Economist, it is estimated that these small beasts destroy an estimated $500 million (462 million euros) worth of coffee beans a year, “reducing the income of some 20 million farmers.

While caffeine usually repels insects, and being exposed to very large doses can be dangerous – for insects as well as humans – researchers have wondered how the coffee berry borer can survive by ingesting the equivalent of 500 shots of espresso for a 68-kilogram person, the Washington Post explains. And they found the answer:

“Researchers removed the digestive tract of dead insects and immersed it in a caffeine solution. They found that fourteen species of bacteria – shared by most of the insects studied – not only allow it to survive all that caffeine, but they also seem to use it as their only source of carbon and nitrogen.

In the same study, published in Nature Communications, scientists also found that without the microbes in the digestive tract, coffee berry borer beetles could not digest caffeine and reproduce efficiently, Newsweek details.

“When they re-inoculated the insects with a species of bacteria called Pseudomonas fulva (which in a rare case caused a case of meningitis in a baby, but is not generally considered dangerous to humans), they were able to metabolize the stimulant again. This proved that it was the microbes and not the insect itself that broke down the caffeine.”

And knowing the role and importance of this bacterium and these microbes could well be crucial in the fight against this insect, reports CNET.

“In a statement, Javier Ceja-Navaro, a scientist at Lawrence Berkeley who is also one of the co-authors of the study explains that the population of coffee berry borer beetles living in crops could be reduced without the use of pesticides, if we can “develop a way to disrupt the bacterium and make caffeine as toxic to this pest as it is to other insects,” he said.

Meanwhile, CNET recalls that a study published in 2014 in the Proceedings of the National Academy of Sciences “suggested that having more trees near plantations could reduce the spread of these nasty invaders. Researchers had developed a computer model of Jamaican coffee plantations that showed that crops that were closer to a large population of trees attracted more insect-eating birds.