Antibiotics are used to treat various diseases and ailments by targetting the bacteria which cause said diseases. Bacteria are subject to natural selection and evolution like any other organism. Random mutation will always occur in individual bacteria cells, and some of these mutations will be helpful in protecting the bacteria from the effects of the antibiotic. The bacteria cells which do not possess such mutations will not be protected, and therefore if the antibiotic is present they will die and fail to reproduce. The cells with the mutation will then have less competition and will reproduce more, and overtime this will result in the evolution of the bacteria to become resistant to the antibiotic.