What factors can lead to a decrease in biodiversity within an ecosystem?