Why they have much more antibiotics than plants for instance?
This isn't fully understood but one theory is that they live in soil feeding off dead things and so are in competition with bacteria and other fungi for resources including space. The antibiotic compounds they produce have been described as a sword and shield. Some compounds are offensive (sword) and attack other fungi and bacteria while other compounds protect a species (shield) from the compounds of other organisms seeking to do the same thing to them. This is only half the story really, fungi also excrete compounds that look similar to antibiotics but have no known function. Still other compounds have seemingly no effect on other organisms but when taken by humans and other mammals lower cholesterol in the blood. Strange thing for a fungus to produce.