Three levels of organisms regulate the flow of energy in ecosystems: the producers, the consumers, and the decomposers. They are organized in complex food webs. Autotrophs—plants, algae, and some bacteria—are the primary producers of an ecosystem. Heterotrophs—animals, fungi, most protists and bacteria, and a few non‐green plants—are the consumers in ecosystems. They obtain their energy and carbon from the organic material produced by the autotrophs. Four trophic (feeding) levels are recognized: The primary producers constitute the first level, followed by three levels of consumers. Primary consumers are the herbivores (plant eaters) that feed directly on the primary producers. The next level includes flesh‐eaters, the primary carnivores that consume the herbivores. The top or fourth level is that of the secondary carnivores that dine on the primary carnivores. At each level, some of the energy acquired is used to do the metabolic work of the consumer, some is stored within the substances of the consumer's body, and much is lost to the environment as heat (not really “lost” since the heat maintains the temperature balance of the Earth and drives the wind circulation patterns that produce the climates).
Another group of organisms vital to the ecosystems are the decomposers that receive energy from all levels (and may contribute energy to some). Because they live on the detritus of ecosystems they sometimes are referred to as detritivores. Without their activities, minerals would not cycle through the biosphere, but would remain locked in the bodies of the organisms that got to them first, and life on Earth would cease—quite an important position for a group of organisms too small to be seen with the naked eye who live buried in the ground.
Two separate types of cycles keep elements moving through ecosystems: gaseous cycles in which the atmosphere is the reservoir and sedimentary cycles in which the rocks of the Earth's crust are the reservoir.