Energy accumulated by the primary producers is transferred via the food chain through different trophic levels, a phenomenon called energy flow. The pathway of energy flow moves from primary producers to primary consumers to secondary consumers and from secondary to tertiary and finally to decomposers.
In the first law of thermodynamics states that processes involving energy transformation will not occur spontaneously unless there is degradation of energy from a non-random form to a random form.
The second law of thermodynamics is the law of conservation of energy, which states that energy may be transformed from one source to another but is neither created nor destroyed.
At each step some of the energy is lost to the environment.