The variety of functional roles played by different species and how they interact with each other and their environment.