Most living things have an innate immune system: a set of mechanisms that fight off potential infections. Humans, for instance, have cells called phagocytes that eat invading bacteria, and bacteria have special enzymes that latch onto viral DNA and cut it to pieces.

But some organisms also have an adaptive immune system, which “remembers” diseases it has been exposed to, so the next time it meets them it can handle them better. This is the basis for vaccination, which uses weakened versions of a disease to prime us for the real thing. Until 2007, it was thought that only vertebrates had an adaptive immune system.

In fact, many single-celled organisms have one. Bacteria often carry repetitive genetic sequences called CRISPRs, which protect them against viruses.

When a bacterium is attacked by a virus, it copies a small piece of the virus’s DNA and stores it among the CRISPRs. The bacterium will then be better at fighting off the virus: the bacterium can acquire resistance, just like a human acquiring resistance to a disease.

The CRISPRs are a library of diseases, storing samples of past infections. If the same kind of virus attacks again, the bacterium is ready. Any viral genes that enter the cell are quickly marked for destruction. […]

But the war isn’t over. Viruses are notoriously adaptable. According to Andrew Camilli of Tufts University in Boston and colleagues, ICP1 has managed to turn the CRISPR system to its own advantage. […] At some point, the virus must have stolen part of the bacterium’s arsenal and re-programmed it to target what was left.