Fungi; although grow best in moist habitats, are found wherever organic matter is present. They are a successful group of land organisms, and posses several features in their body and reproduction that adapt them to their habit and terrestrial mode of life.
Extensive system of fast-spreading hyphae penetrate the substrate and enormously increase the contact and surface area for absorption. Cytoplasmic flow throughout the hyphae is responsible for their rapid growth and spread. Chitin in their thickened hyphal wall is more resistant to decay than are cellulose and lignin found in plant cell wall. They can even break down the lignin (in addition to cellulose) to obtain their nutrients. In saprobes, certain modified hyphae called rhizoids anchor the fungus to the substrate and also digest and then absorb the food.
They are very well adapted to live on land due to lack of flagellated cells, non-motile spores and conidia efficient dispersal b wind, thick-walled zygote and other resistant structures. Hyphae may be modified in such a way as to enable them to reproduce themselves without dependence on external water.
Many fungi are more tolerant than are bacteria to damage in hyperosmotic surroundings. Many can tolerate temperature extremes – 5⁰C below freezing and 50⁰C or more. Now you can tell why molds (e.g. Penicillium) can grow on oranges and jelly kept in a refrigerator, while generally bacteria cannot.