Andrew Read became a scientist so he could spend more time in nature, but he never imagined that would mean a commercial chicken farm. Read, a disease ecologist who directs the Pennsylvania State University Center for Infectious Disease Dynamics, and his research assistant Chris Cairns meandered their way through a hot, humid, pungent-smelling barn teeming with 30,000 young broiler chickens deep in the Pennsylvania countryside. Covered head to toe in white coveralls, the two men periodically stopped and crouched, collecting dust from the ground with gloved hands. Birds squawked and scuttered away. The men transferred the dust into small plastic tubes, which they capped and placed in plastic bags to bring back to the laboratory. “Funny where science leads you,” Read said.

Read and his colleagues are studying how the herpesvirus that causes Marek’s disease — a highly contagious, paralyzing and ultimately deadly ailment that costs the chicken industry more than $2 billion a year — might be evolving in response to its vaccine. Its latest vaccine, that is. Marek’s disease has been sickening chickens globally for over a century; birds catch it by inhaling dust laden with viral particles shed in other birds’ feathers. The first vaccine was introduced in 1970, when the disease was killing entire flocks. It worked well, but within a decade, the vaccine mysteriously began to fail; outbreaks of Marek’s began erupting in flocks of inoculated chickens. A second vaccine was licensed in 1983 in the hopes of solving the problem, yet it, too, gradually stopped working. Today, the poultry industry is on its third vaccine. It still works, but Read and others are concerned it might one day fail, too — and no fourth-line vaccine is waiting. Worse, in recent decades, the virus has become more deadly.

Read and others, including researchers at the U.S. Department of Agriculture, posit that the virus that causes Marek’s has been changing over time in ways that helped it evade its previous vaccines. The big question is whether the vaccines directly incited these changes or the evolution happened, coincidentally, for other reasons, but Read is pretty sure the vaccines have played a role. In a 2015 paper in PLOS Biology, Read and his colleagues vaccinated 100 chickens, leaving 100 others unvaccinated. They then infected all the birds with strains of Marek’s that varied in how virulent — as in how dangerous and infectious — they were. The team found that, over the course of their lives, the unvaccinated birds shed far more of the least virulent strains into the environment, whereas the vaccinated birds shed far more of the most virulent strains. The findings suggest that the Marek’s vaccine encourages more dangerous viruses to proliferate. This increased virulence might then give the viruses the means to overcome birds’ vaccine-primed immune responses and sicken vaccinated flocks.

Most people have heard of antibiotic resistance. Vaccine resistance, not so much. That’s because drug resistance is a huge global problem that annually kills nearly 25,000 people in the United States and in Europe, and more than twice that many in India. Microbes resistant to vaccines, on the other hand, aren’t a major menace. Perhaps they never will be: Vaccine programs around the globe have been and continue to be immensely successful at preventing infections and saving lives.

Recent research suggests, however, that some pathogen populations are adapting in ways that help them survive in a vaccinated world, and that these changes come about in a variety of ways. Just as the mammal population exploded after dinosaurs went extinct because a big niche opened up for them, some microbes have swept in to take the place of competitors eliminated by vaccines.

Immunization is also making once-rare or nonexistent genetic variants of pathogens more prevalent, presumably because vaccine-primed antibodies can’t as easily recognize and attack shape-shifters that look different from vaccine strains. And vaccines being developed against some of the world’s wilier pathogens — malaria, HIV, anthrax — are based on strategies that could, according to evolutionary models and lab experiments, encourage pathogens to become even more dangerous.

Evolutionary biologists aren’t surprised that this is happening. A vaccine is a novel selection pressure placed on a pathogen, and if the vaccine does not eradicate its target completely, then the remaining pathogens with the greatest fitness — those able to survive, somehow, in an immunized world — will become more common. “If you don’t have these pathogens evolving in response to vaccines,” said Paul Ewald, an evolutionary biologist at the University of Louisville, “then we really don’t understand natural selection.”

Yet don’t mistake these findings as evidence that vaccines are dangerous or that they are bound to fail — because undesirable outcomes can be thwarted by using our knowledge of natural selection, too. Evolution might be inevitable, but it can be coaxed in the right direction.

Quick-Change Artists

Vaccine science is brow-furrowingly complicated, but the underlying mechanism is simple. A vaccine exposes your body to either live but weakened or killed pathogens, or even just to certain bits of them. This exposure incites your immune system to create armies of immune cells, some of which secrete antibody proteins to recognize and fight off the pathogens if they ever invade again.

That said, many vaccines don’t provide lifelong immunity, for a variety of reasons. A new flu vaccine is developed every year because influenza viruses naturally mutate quickly. Vaccine-induced immunity can also wane over time. After being inoculated with the shot for typhoid, for instance, a person’s levels of protective antibodies drop over several years, which is why public health agencies recommend regular boosters for those living in or visiting regions where typhoid is endemic. Research suggests a similar drop in protection over time occurs with the mumps vaccine, too.

Vaccine failures caused by vaccine-induced evolution are different. These drops in vaccine effectiveness are incited by changes in pathogen populations that the vaccines themselves directly cause. Scientists have recently started studying the phenomenon in part because they finally can: Advances in genetic sequencing have made it easier to see how microbes change over time. And many such findings have reinforced just how quickly pathogens mutate and evolve in response to environmental cues.

Viruses and bacteria change quickly in part because they replicate like mad. Three days after a bird is bitten by a mosquito carrying West Nile virus, one milliliter of its blood contains 100 billion viral particles, roughly the number of stars in the Milky Way. And with each replication comes the opportunity for genetic change. When an RNA virus replicates, the copying process generates one new error, or mutation, per 10,000 nucleotides, a mutation rate as much as 100,000 times greater than that found in human DNA. Viruses and bacteria also recombine, or share genetic material, with similar strains, giving them another way to change their genomes rapidly. Just as people — with the exception of identical twins — all have distinctive genomes, pathogen populations tend to be composed of myriad genetic variants, some of which fare better than others during battles with vaccine-trained antibodies. The victors seed the pathogen population of the future.

The bacteria that cause pertussis, better known as whooping cough, illustrate how this can happen. In 1992, recommendations from the U.S. Centers for Disease Control and Prevention (CDC) began promoting a new vaccine to prevent the infection, which is caused by bacteria called Bordetella pertussis. The old vaccine was made using whole killed bacteria, which incited an effective immune response but also caused rare side effects, such as seizures. The new version, known as the “acellular” vaccine, contained just two to five outer membrane proteins isolated from the pathogen.

The unwanted side effects disappeared but were replaced by new, unexpected problems. First, for unclear reasons, protection conferred by the acellular vaccine waned over time. Epidemics began to erupt around the world. In 2001, scientists in the Netherlands proposed an additional reason for the resurgence: Perhaps vaccination was inciting evolution, causing strains of the bacteria that lacked the targeted proteins, or had different versions of them, to survive preferentially.

Studies have since backed up this idea. In a 2014 paper published in Emerging Infectious Diseases, researchers in Australia, led by the medical microbiologist Ruiting Lan at the University of New South Wales, collected and sequenced B. pertussis samples from 320 patients between 2008 and 2012. The percentage of bacteria that did not express pertactin, a protein targeted by the acellular vaccine, leapt from 5 percent in 2008 to 78 percent in 2012, which suggests that selection pressure from the vaccine was enabling pertactin-free strains to become more common. In the U.S., nearly all circulating viruses lack pertactin, according to a 2017 CDC paper. “I think pretty much everyone agrees pertussis strain variation is shaped by vaccination,” Lan said.

Hepatitis B, a virus that causes liver damage, tells a similar story. The current vaccine, which principally targets a portion of the virus known as the hepatitis B surface antigen, was introduced in the U.S. in 1989. A year later, in a paper published in the Lancet, researchers described odd results from a vaccine trial in Italy. They had detected circulating hepatitis B viruses in 44 vaccinated subjects, but in some of them, the virus was missing part of that targeted antigen. Then, in a series of studies conducted in Taiwan, researchers sequenced the viruses that infected children who had tested positive for hepatitis B. They reported that the prevalence of these viral “escape mutants,” as they called them, that lacked the surface antigen had increased from 7.8 percent in 1984 to 23.1 percent in 1999.

Some research suggests, however, that these mutant strains aren’t stable and that they may not pose much of a risk. Indeed, fewer and fewer people catch hepatitis B every year worldwide. As physicians at the Icahn School of Medicine at Mount Sinai in New York summarized in a 2016 paper, “the clinical significance of hepatitis B surface antigen escape mutations remains controversial.”

Empty Niche

Scientists usually have to design their own experiments. But in 2000 or so, it dawned on Bill Hanage that society was designing one for him. Hanage, who had just completed his Ph.D. in pathology, had always been fascinated by bacteria and evolutionary biology. And something evolutionarily profound was about to happen to bacteria in America.

A new vaccine called Prevnar 7 was soon to be recommended for all U.S. children to prevent infections caused by Streptococcus pneumoniae, bacteria responsible for many cases of pneumonia, ear infections, meningitis and other illnesses among the elderly and young children. To date, scientists have discovered more than 90 distinct S. pneumoniae serotypes — groups that share distinctive immunological features on their cell surface — and Prevnar 7 targeted the seven serotypes that caused the brunt of serious infections. But Hanage, along with researchers, wondered what was going to happen to the more than 80 others. “It struck me, with my almost complete lack of formal training in evolutionary biology, that this was an extraordinary evolutionary experiment,” he said.