Most scientists assume that microbes produce antibiotic compounds to mediate interactions with other microbes in their neighborhood. The main evidence for this view is the wide distribution of antibiotic resistance genes: many microbes carry the resistance gene for antibiotics that they themselves cannot produce, from which it follows that resistance genes — and by extension the molecules to which they confer resistance — must have a function.
evolutionary history of antibiotics is our current ignorance about their roles in the natural environment. We know what antibiotics can do for us, but what do they do for the producing organism?
1961, Selman Waksman