Food provides energy and thus in a food chain, energy is passed from one link to another. This energy flow is unidirectional - the energy which is transferred from one trophic level to the next does not come back.
When a herbivore eats, only a fraction of the energy (that it gets from the plant food) becomes new body mass; the rest of the energy is lost as heat or is used up by the herbivore to carry out its life processes (movement, digestion, respiration, reproduction).
When the herbivore is eaten by a carnivore, only a small amount of total energy is received by the carnivore. Of the energy transferred from the herbivore to the carnivore, some energy will be lost as heat or used up by the carnivore. The carnivore then has to eat many herbivores to get enough energy to grow.
Because of the large amount of energy that is lost at each link, the amount of energy that is transferred gets lesser and lesser going up the food chain.