Every disease has a history. Some of that history is written in books, and some is written in our DNA.

The earliest records of meningitis — an infection of the membranes that line the brain — reach back to 1685. The British physician Thomas Willis described fevered patients, some of whom suffered from “continual raving” and others who suffered from “horrible stiff extensions in the whole body.”

But meningitis was a threat long before Willis put quill to paper. In a new study, published Thursday in the journal Science, two University of Utah scientists have uncovered a 40-million-year struggle between our ancestors and the bacteria that cause meningitis: As our ancestors evolved new defenses, our enemies evolve counter-defenses. By understanding the history of this struggle, we may be able to fight meningitis more effectively in the future.

A number of species of bacteria can cause meningitis, but two — Haemophilus influenzae and Neisseria meningitidis — are the top threats. Like all bacteria, these pathogens need iron to grow. But we don’t make it easy for them to find iron inside our bodies.