Antibiotics are, initially, molecules naturally synthesized by microorganisms to fight against bacteria competing with their environment. This created a pressure of selection on the bacterial populations, leading to the appearance of resistant strains. In fact, when an antibiotic is used, only bacteria with defense systems against this molecule survive (and reproduce).
hope this helps