Biodiversity is important for ecosystem stability because it ensures that a variety of different species are present to perform various roles within the ecosystem. This diversity helps to increase the resilience of the ecosystem to environmental changes and disturbances, as different species may be able to adapt or fill in ecological niches when others are affected. Additionally, a diverse ecosystem is more likely to provide a wide range of ecosystem services, such as nutrient cycling, pollination, and pest control, which are essential for the overall functioning and health of the ecosystem.