Why are the trophic levels in the shape of a pyramid?

The pyramidale shape of the trophic level come from the loss of energy between the levels.

At the bottom of the chain, The primary productors grow to a certain Biomass level, let’s call it X. The primarys consummers will proceed to eat the primary productors but out of the X they will eat only X minus the energy loss will be used to produce new primary cosumers. And so it goes between each trophic levels