Theory:

In a forest, the deer eats grass, the tiger, in turn, eats the deer. In an ecosystem, there is a chain like relationship present between organisms that inhabit the particular ecosystem.
The sequence of living creatures that represent who eats whom in an ecosystem is called a food chain.
The food chain describes how an organism derives energy and nutrients by eating other organisms. It shows the relationship between the producers and the consumers (e.g. deer, goats, cows and tiger).
 
shutterstock_1124757713_nrw.jpg
Food chain in the terrestrial ecosystem (Forest)
 
  
shutterstock_170827193_new.jpg
Food chain in aquatic ecosystem
  
Flow of energy:
 
The food chain starts with the energy that is given by the sun. Sun is the ultimate source of energy that helps and triggers the process of photosynthesis in the producers.
 
Important!
Energy obtained from the sun is stored in the parts of the plants.
When the grasshopper eats grass, the grasshoppers obtains energy from the grass. The energy thus flows from grass to grasshopper. The frog obtains energy by consuming grasshopper. The energy is then transferred to a snake, when the snake consumes the frog, and so on.
 
Thus, primary energy production in the living worlds is through the plants (through the process of photosynthesis).
 
shutterstock_166005350.jpg
The flow of energy
 
The microorganisms reduce the excreta and dead bodies of animals into simple organic material and put them into the soil in the form of humus.
 
Humus is a nutrient-rich material that helps the plants to grow. Thus energy travels from primary producers to highest level predators, then back to soil.