Bacteria are cells which have natural genetic mutations, thus some bacteria will have advantageous mutations in their DNA. The use of antibiotics in hospitals create a selection pressure on the bacteria population. This means that most bacteria will be destroyed by antibiotics, but some bacteria with advantageous genetic mutations will survive. If a course of antibiotics is not completed, the surviving bacteria will be able to replicate (as competition from other bacteria has already been removed) and the prevalence of resistant bacteria increases.