The structure of trophic pyramids is fundamental to understanding ecosystem functioning, with primary production and ecosystem size serving as two primary determinants. Previous research often adopted an ecosystem perspective, focusing solely on the total biomass of trophic levels while ignoring potential shifts of species richness and composition as ecosystems became more enriched or larger. Here, we first use model simulations to illustrate when and how adopting a community perspective leads to different predictions of how trophic structure changes with both environmental factors. These results highlight richness changes as a putative causal factor contributing to shifts of trophic structure. We then studied 188 natural lakes, showing that these two factors have smaller effects on top-heaviness when they positively affect richness. Our results emphasize the significance of adopting a community-level perspective in predicting energy flow and ecosystem functioning in the face of global change.