Prokaryotes encode an arsenal of highly diverse immune systems to protect themselves against invading nucleic acids such as viruses, plasmids and transposons. This includes invader-interfering systems that neutralize invaders to protect their host, and abortive-infection systems, which trigger dormancy or cell death in their host to offer population-level immunity. Most prokaryotic immune systems are found across different environments and prokaryotic phyla, but their distribution appears biased and the factors that influence their distribution are largely unknown. Here, we compared and combined the prokaryotic immune system identification tools DefenseFinder and PADLOC to obtain an expanded view of the immune system arsenal. Our results show that the number of immune systems encoded is positively correlated with genome size and that the distribution of specific immune systems is linked to phylogeny. Furthermore, we reveal that certain invader-interfering systems are more frequently encoded by hosts with a relatively high optimum growth temperature, while abortive-infection systems are generally more frequently encoded by hosts with a relatively low optimum growth temperature. Combined, our study reveals several factors that correlate with differences in the distribution of prokaryotic immune systems and extends our understanding of how prokaryotes protect themselves from invaders in different environments.