Biomass is the mass of living material in an animal or plant.
As all energy comes from the sun that means the biomass is originally from the sun. the energy stored in plant cells comes from the sun and adds to their biomass.
The energy in the biomass made by plants is passed on through the food chains or food webs into the animals which eat the plants. Then it is passed into the animals which eat other animals. No matter how complicated or long the food chain is, the original source of all the biomass involved is energy from the sun.
Looking at food chains, there are usually more producers than primary consumers and more primary consumers than secondary consumers. If you count the number of organisms at each level you can compare them. This is shown in a pyramid of numbers, but this is does not accurately reflect what is happening.