Background Phages are key drivers of genomic diversity in bacterial populations as they impose strong selective pressure on the evolution of bacterial defense mechanisms across closely related strains. The pan-immunity model suggests that such diversity is maintained because the effective immune system of a bacterial species is the one distributed across all strains present in the community. However, only few studies have analyzed the distribution of bacterial defense systems at the community-level, mostly focusing on CRISPR and comparing samples from complex environments. Here, we studied 2778 bacterial genomes and 188 metagenomes from cheese-associated communities, which are dominated by a few bacterial taxa and occur in relatively stable environments. Results We corroborate previous laboratory findings that in cheese-associated communities nearly identical strains contain diverse and highly variable arsenals of innate and adaptive (i.e., CRISPR-Cas) immunity systems suggesting rapid turnover. CRISPR spacer abundance correlated with the abundance of matching target sequences across the metagenomes providing evidence that the identified defense repertoires are functional and under selection. While these characteristics align with the pan-immunity model, the detected CRISPR spacers only covered a subset of the phages previously identified in cheese, providing evidence that CRISPR does not enable complete immunity against all phages, and that the innate immune mechanisms may have complementary roles. Conclusions Our findings show that the evolution of bacterial defense mechanisms is a highly dynamic process and highlight that experimentally tractable, low complexity communities such as those found in cheese, can help to understand ecological and molecular processes underlying phage-defense system relationships. These findings can have implications for the design of robust synthetic communities used in biotechnology and the food industry.