Energy in any ecosystem ultimately comes from the Sun. Sunlight is converted into food by plants. Energy from the sun then becomes chemical energy in the form of food. Primary consumers then eat the plants for energy. The energy moves up the levels of the food chain as larger animals eat smaller ones. All the while, much of the food energy is lost as work done by the animals' bodies and as body heat (This can also be shown through using trophic levels).