Broadly speaking, fitness in microbiology is the ability of microbes to thrive in a competitive environment. It is often determined by comparing the growth rate in a given environment of a mutant strain with that of its non-mutant isogenic relative. If the mutant is less fit, it will grow more slowly under specific circumstances. A typical example is a mutant that has acquired the ability to grow in the presence of a certain concentration of an antibiotic. Obviously, such a mutant will grow in the presence of the drug, its parent will not. However, in the absence of the drug, the parent will outgrow the mutant. This is attributed to a 'fitness cost', the metabolic burden of having to make the enzymes involved in drug resistance. The fact that such enzymes again would be useful, should the drug be reintroduced later, is of little consequence because bacteria, again broadly speaking, do not have strong ways of anticipating the future.
The fitness cost may be increased by the need to carry antibiotic resistance genes on a plasmid, itself an energetically expensive proposition. However, the cost of carrying resistant genes on the chromosome, rather than on plasmids, may be even greater. It is not surprising, therefore, that, eventually, antibiotic resistant strains are often lost from the environment. This suggests strategies to cope with the increase in antimicrobial drug resistance.
An analogous situation goes for the ability of bacteria to grow as pathogens in a host. To be successful, the bacteria must make virulence factors that are of little use in a broth culture in the lab. Here, the non-pathogens now outgrow the pathogens, which is illustrated by fact that strains in culture collection often have lost their pathogenicity. But even in a host, the non-pathogens can have a fitness advantage by freeloading on the virulence factors made by the pathogen.
Fitness pertains to non-pathogens as well. Thus, bacteria in the mammalian gut become more fit by the acquisition of special genes from other species.
A review of ways to estimate fitness is presented here. The most often used of them is to set up two strains in competition with one another. Mixing the two and allowing them to grow in a lab medium will favor the growth of the more fit of the two. Since one can readily grow bacteria over many generations, even small differences in growth rates will soon result in measurable difference in the size of the two populations. As discussed here, this gives a measure of relative, rather than absolute fitness, and is not free of certain limitations. Additionally, other methods than measuring growth rates outside the lab are available, including using molecular techniques to detect bar-coded strains.