The sun gives energy to producers or plants. Then, the herbivores that eat the plants. After that the first level consumers eat the herbivores. Then the second level consumers eat the first level consumers, then so on. This might seem like there is a lot of energy from level to level. But, only 10% of each level goes to the next level. The other 90% is used for energy.
Thanks for the opportunity to answer your question and I hope that this helps! :)