Earthquakes can have both direct and indirect impacts on ecosystems. Direct effects can include habitat destruction, landslides, and changes in soil composition. Indirect effects may include alterations in water availability, nutrient cycling, and species interactions. Overall, earthquakes can disrupt ecosystems and lead to changes in biodiversity and ecosystem dynamics.