Antibiotic resistance originates from bacterial populations attempting to gain survival advantages over neighbouring populations. By evolving the ability to synthesise and secrete toxic compounds, it became possible to kill other cells.
Due to this, mutations in the population being attacked by the antibiotic allowed resistance to develop. This could have been in the form of efflux pumps – these are relatively easy to modify, pumping the toxic compounds out of the bacteria to maintain a safe concentration. The target for the antibiotic could also change. Some antibiotics can have resistance develop with just one amino acid residue being mutated, while still maintaining the original biological function.
More recently, with large increases in the use of antibiotics against human bacterial infections and as agricultural growth promoters and prophylactics, resistance has become widespread. This is through horizontal gene transfer and mutations where antibiotics are prescribed for too long, or not long enough, or the wrong antibiotic is used. Due to this, there is the potential for routine surgery or injury to lead to life-threatening untreatable infections.