An ecosystem is an organization that includes all living organisms (biotic components) in an area as well as its physical environment (abiotic components), functioning together as a unit.
Biotic components are living organisms within a particular ecosystem. They include primary producers, herbivores, carnivores, omnivores, and decomposers.
Abiotic components are the non-living parts of the environment in which the organisms live, such as sunlight, water or moisture, soil, and so on.
Organisms in an ecosystem depend on each other for subsistence. Trophic levels refer to the respective position of the organisms within ecological food chains or webs. The lowest level contains the primary producers or green plants. Second-level organisms or herbivores depend on green plants for their food. Carnivores, which feed on the herbivores, constitute a third level. Finally, the decomposers (bacteria and fungi) break down dead organisms and waste materials into nutrients usable by the producers.
A food chain begins with the plants using energy from sunlight (photosynthesis) to produce food. Herbivores, such as zebras, eat plants. Then the secondary consumers, such as lions, eat zebras. When a lion dies, the decomposers break up its body.
The function of an ecosystem is to contribute to its self-maintenance, including the sustenance of wildlife habitat.