Plasmids may carry genes that provide resistance to naturally occurring antibiotics in a competitive environmental niche, or the proteins produced may act as toxins under similar circumstances. Plasmids can also provide bacteria with the ability to fix nitrogen or to degrade recalcitrant organic compounds that provide an advantage when nutrients are scarce