Bacterial endosymbiosis is an important evolutionary process in insects, which can harbor both obligate and facultative symbionts. The evolution of these symbionts is driven by evolutionary convergence, and they exhibit among the tiniest genomes in prokaryotes. The large host spectrum of facultative symbionts and the high diversity of strategies they use to infect new hosts probably impacts the evolution of their genome and explains why they undergo less severe genomic erosion than obligate symbionts. Candidatus Hamiltonella defensa is suitable for the investigation of the genomic evolution of facultative symbionts because the bacteria are engaged in specific relationships in two clades of insects. In aphids, H. defensa is found in several species with an intermediate prevalence and confers protection against parasitoids. In whiteflies, H. defensa is almost fixed in some species of Bemisia tabaci, which suggests an important role of and a transition towards obligate symbiosis. In the present study, comparisons of the genome of H. defensa present in two B. tabaci species (MEAM1 and MED) and in the aphid Acyrthosiphon pisum revealed that they belong to two distinct clades and underwent specific gene losses. In aphids, it contains highly virulent factors that could allow protection and horizontal transfers. In whiteflies, the genome lost these factors and seems to have a limited ability to acquire genes. However it contains genes that could be involved in the production of essential nutrients, which is consistent with a primordial role for this symbiont. In conclusion, while both lineages of H. defensa have mutualistic interactions with their hosts, their genomes follow distinct evolutionary trajectories that reflect their phenotype and could have important consequences on their evolvability.