In ecosystems, homeostasis helps maintain a balance among living organisms and their external environment, ensuring that the ecosystem remains sustainable over time.