Ecosystem comprises of the physical environment and the organisms which live therein. In this ecosystem, there is also the movement of energy and mineral from one organism to another. The sun is the chief source of all energy. It provides radiant energy to the producers (green plants) to manufacture their own food. The energy is transferred from producers to herbivores and then to carnivores. When they die they provide energy to the decomposers (called detritus feeders). A part of the food energy consumed is assimilated by organ­isms and the rest of it is dissipated as heat, by respiration. The flow of energy from the sun is unidirectional, that is, it is non-cyclical.

The movement of mineral network from the soil to the plant helps in the growth of plants. These nutrients are passed on to the herbivores and from the herbivores to the carnivores for their growth. When the plants, animals and other organisms die, decomposers like bacteria and fungi feed on them. They convert them into inorganic nutrients. This inorganic nutrient becomes a part of the soil and is recycled (drawn) by the plants. The flow of mineral nutrients is thus cyclical. Thus, by the continuous input of energy from the sun and cyclic movement of mineral nutrients, the ecological system maintains its stability. Decomposers play a very important role in maintaining the supply of mineral nutrients in the ecosystem.