In a food web, solar energy is captured by green plants and algae and converted to chemical energy by the process of photosynthesis. These organisms are autotrophs (producers) and the energy in their tissues is later transferred to heterotrophs (consumers) that feed on pre-formed organic matter.
Chemicals in the body of a dead organism or its wastes will be returned to the ecosystem via the process of decomposition. Fungi along with bacteria are very important organisms capable of decaying organisms, returning vital chemical compounds back to the environment to be recycled. They do this by breaking down organic compounds in the dead organism or its wastes, returning the inorganic chemical elements back to the environment.
Carbon, sulfur, nitrogen, phosphorus and others must be recycled between living things and their environment because there is not an unlimited supply of those elements. Decomposition prevents the build up of dead leaves, organisms and their wastes while helping to return vital chemicals back to the food web to be used again by producers and later by consumers.