Only about 10% is stored at higher trophic level and the remaining 90% is lost in respiraton, decomposition and waste in the form of heat. Suppose 2000J of solar energy is incident on green vegetation. The latter having about 1% efficiency, trap about 20J of energy and convert it into chemical energy by photosynthesis.
The remaining would be lost to the environment. The herbivore that feeds on producers get 10% of the energy stored in plants, i.e. 2J. The remaining 18J are lost to the environment. Carnivores feeding on herbivores would be able to store only 0.2J of energy as flow.