Food chain: In an ecosystem, the sequential chain of eating and being eaten is called a food chain.
The common examples of food chain are Grasses-cattle-tiger (the chain consists of three links)
Grasses-grasshopper- birds-hawks (the chain consists of four links)
Phytoplankton-water fleas-small fish-tuna(the chain consists of three links)
Two types of food chain can be found in natural ecosystem. One type starts from green plants (autotrophs) constituting the first trophic level,
the herbivores form the second trophic level and predators form the third trophic level. They are referred to as grazing food chain, The other type starts with debris detritus produced by green plants and is termed as detritus food chain. A food chain it always unidirectional.
Food Web: A number of food chains interwoven with one another give rise to a structure similar to the web pf a spider. These interlocking patterns formed by several food chains that are linked together are called food webs. So a food web is a network of food chains where different types of organisms are connected at different trophic levels, so that there are a number of options of eating and being eaten at each trophic level.

The two most important functions of the ecosystem i.e. energy flow and nutrient cycling take place through them.