Most antibiotics are based on natural products synthesized by bacteria and fungi. Quinolones (like Cipro) and sulfa drugs (like sulfamethoxazole) are the major exceptions to this rule.
Antibiotics belong to a class of natural compounds called secondary metabolites. These are molecules that are not essential to normal growth and metabolism (like sugars, amino acids and nucleic acids) but perform specialized roles. Secondary metabolites enable creatures that can’t move or speak to communicate, control their environments and defend themselves.
Bacteria, plants and fungi are much better than human chemists at creating complex molecules. These biosyntheses are often accomplished in factories within cells, large complexes of enzymes in which various precursors and intermediates are assembled, modified and passed on.
Vancomycin, the most commonly prescribed antibiotic in US hospitals, is a good example:
Although total synthesis of vancomycin has been accomplished in labs, I believe that it is still produced commercially by fermentation of the bacterium Amycolatopsis orientalis from which it was first isolated.
The thing to keep in mind about these secondary metabolites is that anything that is made by an enzyme can also be broken down by an enzyme – often the same one that made it. Small tweaks to these enzymes, or just putting them in a different environment, can cause them to degrade antibiotics. Antibiotic resistance is thus an intrinsic and inevitable feature of antibiotic use.