system
Given the following post, respond as if you're commenting on Reddit:
human
How do bacterial species that naturally produce antibiotics (like penicillin or doxorubicin) avoid killing themselves?
gpt
It's due to resistance. Different antibiotics have different mechanisms of action. Because of this, most bacteria are inherently 'resistant' to some antibiotics (even ignoring developed resistances) because they simply lack the target of the antibiotic. That is to say, the antibiotic simply will not affect them because it doesn't have it's target to act on. Acquired resistances such as alternate pathway, exporters, mechanisms to break down the antibiotic can prevent a bacterium being susceptible.

The bacteria which produce antibiotics are either inherently resistant by way of design, or have an acquired resistance mechanism to the antibiotic they produce.

As an aside, penicillin comes from a fungus.