Why do bacteria become resistant to antibiotics?

Antibiotic resistance is a natural phenomenon. Some bacteria produce antibiotics to eliminate bacterial competitors in their close environment. It is therefore not surprising that bacteria have developed resistance mechanisms to defend themselves against those antibiotics. Antibiotic resistance is ancient and can be found in places where bacteria have had no contact with human life (such as in the deep permafrost for example) or in the gut of remote amazonian tribes.