The diversity of species and genes in ecological communities affects the functioning of these communities. ... The two main areas where the effect of biodiversity on ecosystem function have been studied are the relationship between diversity and productivity, and the relationship between diversity and community stability.