Simulated population dynamics of phage-resistant and -susceptible bacteria within biofilms. These dynamics underlie the competition outcomes in Fig. 1. Time is shown in days (d). (A) The frequency of resistant cells is shown in traces colored according to their initial frequency, with the standard deviation across all replicate runs as transparent blue regions around each trace (n = 90 to 100 replicate simulations per trace). (B) When resistant cells are initially a minority, susceptible cells are exposed to phages and largely killed off, allowing resistant cells to reseed the population and markedly increase in relative abundance relative to the strain ratio prior to phage exposure. (C) When resistant cells are initially more common, and phages cannot diffuse freely through the biofilm, susceptible cells are spatially protected from phage exposure because phages are sequestered in clusters of resistant cells.