Fungi, like bacteria and protistans, are a group that is small, but very important to the environment. Most of the fungi in the world are saprophytic, or decomposers. Because of their small, thread-like mycelium, they are able to permeate soil and dead tissues. This makes them for suitable for their saprophytic lifestyles. Over a long time, even the largest dead tree will be reduced to crumbling dust as the fungi that invade the dead tissue begin to digest it. Fungi also decompose leaf litter and dead animals.
Of course, we think of fungi in what they can provide for us, namely antibiotics. Fungi have evolved this chemical method of killed bacteria as a way to fend off competitors. Basically, most fungi like to live in warm, moist areas and digest dead tissues. Most bacteria like to live in warm, moist areas and digest dead tissues. This means that sometimes bacteria and fungi come into direct competition over food and space. Antibiotics give fungi the advantage in that they can release these chemicals that are toxic to the bacteria and take the resources for themselves. Modern doctors prescribe antibiotics to patients who are suffering from a bacterial infection.