Genetic diversity within a species allows for adaptation, resilience, and long-term viability. It provides the raw material for evolution and reduces the risk of inbreeding. Species diversity refers to the variety of species within an ecosystem. Both types of diversity are crucial for ecosystem health and function.