Although similar to any other organism, prokaryotes can transfer genes vertically from mother cell to daughter cell, they can also exchange certain genes horizontally. Genes can move within and between genomes at fast rates because of mobile genetic elements (MGEs). Although mobile elements are fundamentally self-interested entities, and thus replicate for their own gain, they frequently carry genes beneficial for their hosts and/or the neighbours of their hosts. Many genes that are carried by mobile elements code for traits that are expressed outside of the cell. Such traits
are involved in bacterial sociality, such as the production of public goods, which benefit a cell’s neighbours, or the production of bacteriocins, which harm a cell’s neighbours. In this study we review the patterns that are emerging in the types of genes carried by mobile elements, and discuss the evolutionary and ecological conditions under which mobile elements evolve to carry their peculiar mix of parasitic, beneficial and cooperative genes.