Phase variation is a stochastic mechanism of regulating gene expression, allowing multiple different phenotypes to be expressed in a single population. This variation within a clonal population (of bacteria) may increase the chances of survival if an environmental change occurs.
For example, a small number of bacteria in a population may express a specific antimicrobial efflux pump, conveying resistance. Although that antibiotic may not be present in the environment, if it is later added, a small group will be able to survive. This helps ensure the survival of the population.
It isn’t beneficial for bacteria to express all of their proteins for every different environmental condition. Therefore, by using this random method (phase variation), across a large enough population, there will be enough bacteria present that can survive in different conditions, helping to ensure the survival of the population. Expressing proteins has an energy cost, so many bacteria will only express the specific proteins they need to survive at that moment in time, preserving the available energy sources.
Phase variation works by having a promoter region that flips (inverts) randomly. This lets specific genes be expressed, without mutating the genome.
Frequently, this process is used to suppress antigens on the cell surface membrane of the bacteria, allowing it to evade detection by the immune system, but this method is possible with any bacterial gene.