The genetic makeup of a pathogen can change through mutations, which can be either spontaneous or induced by environmental factors such as antimicrobial drugs. These genetic changes can confer advantages to the pathogen, such as resistance to drugs or enhanced infectivity. The principle of natural selection then ensures that these advantageous strains proliferate.