An ecosystem consists of biotic and abiotic components that interact and depend on one another. The biotic components include producers, consumers, and decomposers. Producers such as plants harness energy from the sun through photosynthesis to produce organic compounds, which consumers like herbivores and carnivores feed on directly or indirectly. Decomposers break down dead organic matter and cycle nutrients back into the environment. Energy flows through the ecosystem as organisms consume other organisms. Nutrients also cycle through biogeochemical cycles as organisms uptake and release elements like carbon and phosphorus. A balanced ecosystem maintains stable populations through interconnected food chains and limits the destruction of any component.