Pediococcus acidilactici is a reliable bacteriocin producer and a promising probiotic species with wide application in the food and health industry. However, the underlying genetic features of this species have not been analyzed. In this study, we performed a comprehensive comparative genomic analysis of 41 P. acidilactici strains from various ecological niches. The bacteriocin production of 41 strains were predicted and three kinds of bacteriocin encoding genes were identified in 11 P. acidilactici strains, namely pediocin PA-1, enterolysin A, and colicin-B. Moreover, whole-genome analysis showed a high genetic diversity within the population, mainly related to a large proportion of variable genomes, mobile elements, and hypothetical genes obtained through horizontal gene transfer. In addition, comparative genomics also facilitated the genetic explanation of the adaptation for host environment, which specify the protection mechanism against the invasion of foreign DNA (i.e. CRISPR/Cas locus), as well as carbohydrate fermentation. The 41 strains of P. acidilactici can metabolize a variety of carbon sources, which enhances the adaptability of this species and survival in different environments. This study evaluated the antibacterial ability, genome evolution, and ecological flexibility of P. acidilactici from the perspective of genetics and provides strong supporting evidence for its industrial development and application.