We can use an ecological pyramid to trace the flow of matter and energy in an ecosystem. The pyramid is a representation of the food chain, and consists of various steps or trophic levels. The flow of energy takes place from producers to consumers (and higher consumers).
The lowest trophic level, in an ecological pyramid, consists of the producers who produce energy from photosynthesis (generally, such as plants). This level is the widest and contains the largest number, highest mass and thus highest energy. The next tropic level covers the herbivores, consumers who eat the species at the lowest trophic level for energy. Since it takes a large number of plants to sustain an herbivore (say deer or cow), the number of herbivore is very small as compared to the number of plants. Thus, the amount of matter and energy contained within the second trophic level is also less. The next trophic level represents the carnivores, who consume herbivores to satisfy their energy requirements, such as a lion eating a deer. Here again, the number of carnivores is much smaller than that of herbivores and so the amount of matter and energy contained in this level is also less.
Therefore, the higher we move along an ecological pyramid, the number of organisms and amount of matter and energy contained within each level decreases.