Fungi serve as a kind of natural cleaning crew for the ecosystem. They form enzymes that can degrade hazardous substances, converting natural as well as human-made toxins into harmless compounds. For instance, they can help to break down synthetic dyes, which accumulate in great amounts during the production of textiles.