According to Darwin, environment selects organisms with favourable variations and these organisms are allowed to survive. When a bacterial population encounters a particular antibiotic, those sensitive to it die. But some bacteria having mutations become resistant to the antibiotic. Such resistant bacteria survive and multiply quickly as the competing bacteria have died. Some the resistance providing genes become widespread and entire bacterial population becomes resistant.