Ferns play several important ecological roles. They provide shelter and food for small animals, help stabilize disturbed soil, and prevent nutrient leaching. Some ferns indicate the presence of certain metals in soil. Ferns also create diverse microhabitats that support a range of organisms by providing moisture, shade, and surfaces for seed germination. Invasive fern species can disrupt local ecosystems.