Mobile genetic elements (MGEs), such as phages and plasmids, often possess accessory genes encoding bacterial functions that are not essential to MGEs. What evolutionary rules govern the arsenal of accessory genes MGEs carry? Such rules, if they exist, might reflect the different infection strategies of MGEs, such as whether MGEs lyse host cells when they spread to other cells. Here we investigate whether different MGEs carry different types of accessory genes by comprehensively analysing public databases. Specifically, we compare prophages and plasmids with respect to the frequencies at which they carry antibiotic resistance genes (ARGs) and virulence factor genes (VFGs) in 21 pathogenic species of bacteria spanning three phyla (Actinobacteria, Firmicute, and Proteobacteria). The results indicate that prophages and plasmids display opposite trends: prophages are biased towards carrying VFGs more frequently than ARGs in two species of Gammaproteobacteria (Escherichia coli and Salmonella enterica) and one species of Firmicute (Staphylococcus aureus), whereas plasmids are biased towards carrying ARGs more frequently than VFGs in six species of Gammaproteobacteria (Acinetobacter baumannii, E. coli, Klebsiella pneumoniae, Pseudomonas aeruginosa, S. enterica, and Vibrio cholerae), one species of Epsilonproteobacteria (Campylobacter jejuni), and two species of Firmicutes (Enterococcus faecalis and S. aureus). In the other species, prophage-borne or plasmid-borne ARGs and VFGs are barely detected. Taken together, our results suggest that MGEs differentiate in terms of the types of accessory gene they carry depending on their strategies of infection, providing an insight into the rules of evolution governing horizontal gene transfer mediated by MGEs.