The study of the variety and richness of life on Earth, including the diversity of species, genes, and ecosystems.