Plasmids may carry genes that provide resistance to naturally occurring antibiotics in a competitive environmental niche, or alternatively the proteins produced may act as toxins under similar circumstances. Plasmids also can provide bacteria with an ability to fix elemental nitrogen or to degrade difficult organic compounds. This may provide an advantage under conditions of nutrient deprivation.