Energy flows through an ecosystem as animals eat plants or other animals forming overlapping food webs. The source of all energy comes from plants. Plants get their energy by changing sunlight into food through the process of photosynthesis. This is why, in a food web, plants are called the producers - as they produce the energy on which all living things depend. Animals, which eat (consume) plants and other animals, are called consumers in a food web. The living things that eat and recycle dead animals and plants are called the decomposers. These include insects, bacteria, mushrooms, and other fungi. The decomposers are an important part of any ecosystem because they break down dead matter and recycle it back into the soil. Soil nutrients, in turn, help plants grow and begin the cycle over and over again.
Read more and study the diagram.