When a bacterial population encounters a particular antibiotic, those sensitive to it die. One or few bacteria, having mutations which make them resistant to the antibiotic, survive. Such resistant bacteria multiply quickly as the competing bacteria have died. Soon, the resistance-providing genes become widespread and entire bacterial population becomes resistant.