We have been using penicillin for only 70 years, and penicillin resistant gram-positive pathogenic bacteria began to proliferate with the alarming speed. It is not too difficult to subvert the function of this beta-lactam antibiotic by cleaving a particular C-N bond. If that is so simple, why does this antibiotic work at all? Simple logic suggests that bacteria should have become resistant to fungal penicillin millions of years ago. The possible answer is non-trivial. First, one has to take a closer look:
...While β-lactam compounds were discovered in filamentous fungi, actinomycetes and gram-negative bacteria are also known to produce different types of β-lactams. All β-lactam compounds contain a four-membered β-lactam ring. The structure of their second ring allows these compounds to be classified into penicillins, cephalosporins, clavams, carbapenens or monobactams. Most β-lactams inhibits bacterial cell wall biosynthesis but others behave as β-lactamase inhibitors and even as antifungal agents (e.g., some clavams). The intermediates of the pathways, the characteristics of the enzymes involved, the lack of introns in the genes and bioinformatic analysis suggest that all of them should have evolved from an ancestral gene cluster of bacterial origin, which was surely transferred horizontally in the soil from producer to non-producer microorganisms. The receptor strains acquired fragments of the original bacterial cluster and occasionally inserted new genes into the clusters, which once modified, acquired new functions and gave rise to the final compounds that we know. When the order of genes in the Streptomyces genome is analyzed, the antibiotic gene clusters are highlighted as gene islands in the genome. Nonetheless, the assemblage of the ancestral β-lactam gene cluster remains a matter of speculation.
http://www.im.microbios.org/0901/0901009.pdf (a nice review of biochemistry of beta-lactams + speculatations o the evolution of their biosynthesis)
also
this review Beta-lactams were not invented by fungi; it was and still is a bacterial weapon. The horisontal transfer from beta-lactam producing soil bacteria to fungi occurred around 370 Mya. The fungi do not need beta-lactams to protect themselves against their pathogens; the function of their penicillin is different:
...The presence of genes for β-lactam antibiotics, and therefore the ability to produce these compounds, confer a major ecological advantage to soil fungi, which are thus able to protect nutrient sources that would otherwise be used by fast-growing bacteria.
Why do soil bacteria produce anti-bacterial agents? Beta-lactams are hardly an exception; actinobacteria (e.g., acino- and streptomycetes that look uncannily similar to fungi) produce many such antibiotics, e.g. tetracyclines.
...In prokaryotes, the advantage of producing β-lactams is less clear. Since most bacteria are sensitive to β-lactams, producer bacteria might therefore be killed by their own antibiotics; however, β-lactam-producing bacteria are somehow less sensitive to β-lactams... It seems that cephamycin C is of ecological importance to this strain in natural habitats in which it competes with cephamycin-sensitive bacteria.
As long as there has been soil, there have been soil bacteria. The competition between these soil bacteria drove some of them to develop a potent weapon against the competing strains. These aggressive strains have always been resistant to beta-lactams they produce as this is their game. Somehow the genes coding for the biosynthesis of the beta-lactams were passed to fungi that used it to the same end: eliminating some of the bacterial competition. Is this strategy efficient? Not really:
...While hunting for soil bacteria that can turn plant waste to biofuels, a team of microbiologists led by George Church of Harvard University, Boston, Massachusetts, decided to grow soil samples in pure antibiotics as a control. "We expected not to find a lot of bacteria that could eat antibiotics for breakfast," says Church. "We were kind of surprised." To make sure the discovery was not a fluke, his team collected more dirt from farms, forests and parks around the northeast United States and Minnesota. All the soil samples contained bacteria that can survive on antibiotics, and many subsisted on multiple drugs, he says. Not only could the soil bacteria live on older antibiotics that many bacteria have developed resistance to, such as penicillin, but they could digest modern-day silver bullets as well, including ciprofloxacin. Many of the bacteria were found to be impervious to the bulk of antibiotics, although they often could not grow without alternative food sources. "They are resistant to virtually all antibiotics," says microbiologist Morten Sommer, also at Harvard. Among 75 strains the team tested, half were resistant to clinical doses of 17 of 18 antibiotics.
http://www.newscientist.com/article/dn13587-soil-ultrabugs-thrive-on-a-diet-of-antibiotics.htmlthe article is on
http://arep.med.harvard.edu/pdf/Dantas08.pdf In other words, not only does penicillin secretion by fungi confers relatively little advantage to the fungus, there are bacteria SUBSISTING on these beta-lactams! So why does the fungus keep on producing the penicillin? Because once had it started this warfare it cannot afford stopping it. Its bacterial competition fully expects it to fight at its full might. Fighting these fungal beta-lactams drains the energy of the bacteria, but life is dear. And if these antibacterial agents are not produced, the soil bacteria slowly but surely start outcompeting the fungus for nutrients. It is the dead end: the enormous amount of energy is exerted to reproduce the status quo that existed before the production of beta-lactams by the fungi had started eons ago. The advantage of producing penicillin was short-lived, but there is no way back, as the soil bacteria are persistent and merciless. It is exactly the same story as the evolution of the active immune system in the vertebrates that also failed to provide stronger immunity than the passive immune system, because the virulence of the pathogens had been adjusted accordingly. It is impossible to fight microbial evolution.
So why does penicillin work on human pathogens? Because these bacteria has never needed to develop resistance to beta-lactams. Now they are developing it, and the result will be another stalemate.