Abstract
Bacteria have evolved various antiviral defense systems (DSs) to protect themselves, but how DSs respond to the variation of bacteriophages in complex bacterial communities and whether DSs function effectively in maintaining the stability of bacterial community structure and function remain unknown. Here, we conducted a long-term metagenomic investigation on the composition of bacterial and phage communities of monthly collected activated sludge (AS) samples from two full-scale wastewater treatment plants over 6 years and found that DSs were widespread in AS, with 91.1% of metagenome-assembled genomes (MAGs) having more than one complete DS. The stability of the bacterial community was maintained under the fluctuations of the phage community, and DS abundance and phage abundance were strongly positively correlated; there was a 0-3-month time lag in the responses of DSs to phage fluctuations. The rapid turnover of clustered regularly interspaced short palindromic repeat spacer repertoires further highlighted the dynamic nature of bacterial defense mechanisms. A pan-immunity phenomenon was also observed, with nearly identical MAGs showing significant differences in DS composition, which contributed to community stability at the species level. This study provides novel insights into the complexity of phage-bacteria interactions in complex bacterial communities and reveals the key roles of DSs in stabilizing bacterial community structure and function.