Stenotrophomonas strains, which are often described as plant growth promoting (PGP) bacteria, are ubiquitous in many environments. A total of 213 genomes of strains of Stenotrophomonas were analyzed using comparative genomics to better understand the ecological roles of these bacteria in the environment. The pan-genome of the 213 strains of Stenotrophomonas consists of 27,186 gene families, including 710 core gene families, 11,039 unique genes and 15,437 accessory genes. Nearly all strains of Stenotrophomonas harbor the genes for GH3-family cellulose degradation and GH2- and GH31-family hemicellulose hydrolase, as well as intact glycolysis and tricarboxylic acid cycle pathways. These abilities suggest that the strains of this genus can easily obtain carbon and energy from the environment. The Stenotrophomonas strains can respond to oxidative stress by synthesizing catalase, superoxide dismutase, methionine sulfoxide reductase, and disulfide isomerase, as well as managing their osmotic balance by accumulating potassium and synthesizing compatible solutes, such as betaine, trehalose, glutamate, and proline. Each Stenotrophomonas strain also contains many genes for resistance to antibiotics and heavy metals. These genes that mediate stress tolerance increase the ability of Stenotrophomonas strains to survive in extreme environments. In addition, many functional genes related to attachment and plant colonization, growth promotion and biocontrol were identified. In detail, the genes associated with flagellar assembly, motility, chemotaxis and biofilm formation enable the strains of Stenotrophomonas to effectively colonize host plants. The presence of genes for phosphate-solubilization and siderophore production and the polyamine, indole-3-acetic acid, and cytokinin biosynthetic pathways confer the ability to promote plant growth. These strains can produce antimicrobial compounds, chitinases, lipases and proteases. Each Stenotrophomonas genome contained 1–9 prophages and 17–60 genomic islands, and the genes related to antibiotic and heavy metal resistance and the biosynthesis of polyamines, indole-3-acetic acid, and cytokinin may be acquired by horizontal gene transfer. This study demonstrates that strains of Stenotrophomonas are highly adaptable for different environments and have strong potential for use as plant growth-promoting bacteria.