Firstly, antibiotic resistance has to be gained by a bacterium through the mutation of a gene. This can occur due to, for example, the overuse of antibiotics or failure to complete a full course of antibiotics. A random mutation in the DNA of a bacterium may lead to a gene that provides resistance to a certain antibiotic. This is the first stage of gaining antibiotic resistance.
The next stage is the multiplication of this gene. This can occur through asexual reproduction of the resistant bacterial cell, or through a process called 'conjugation'. This is where one bacterium - in this case, the resistant cell - extends a pilus to another bacterium, and transfers a plasmid (a circular DNA sequence) to the other cell through replication of this DNA. The receptive cell now also contains a copy of the resistance gene and can pass it onto other bacterial cells, through asexual reproduction or conjugation. Antibiotic resistance can then spread throughout the population, the species, and onto other species, as bacteria can often conjugate outside their own species.