The producers convert solar energy into chemical energy in the form of organic compounds. The primary consumers (herbivores) derive their nutrition from the producers. According to the energy transfer law, only 10% of energy is transferred from one trophic level to the other. So, the energy that is captured by the producers does not revert back to the Sun and the energy transferred to the herbivores does not come back to the producers. It just keeps on moving to the next trophic level in a unidirectional way. That is why the flow of energy in the food chain is always unidirectional.

A large number of pesticides and chemicals are used to protect our crops from pests and diseases. Some of these chemicals are washed down from the soil, while some enter the water bodies. From the soil, they are absorbed by plants along with water and minerals; and from the water bodies, they are taken up by aquatic plants and animals. This is how these chemicals enter the food chain. As these chemicals cannot decompose, they accumulate progressively at each trophic level. This increase in the concentration of harmful chemicals with each step of the food chain is called biomagnification. As human beings occupy the top level in any food chain, these chemicals get accumulated in our bodies.
Energy flow is unidirectional beacause plants being producer trap the energy from sun which cannot be revert back,also the energy that is taken by consumer cannot be taken back so it is said that flow of energy in food chain is unidirectionalm