A general biodiversity–function relationship is mediated by trophic level