How does biodiversity affect the stability of an ecosystem?