The ecosystem is a community of living organisms in conjunction with the nonliving components of their environment, interacting as a system. These biotic and abiotic components are regarded as linked together through nutrient cycles and energy flows.
Energy flow in the ecosystem is often described as a food web, a complex network of interconnected food chains. The primary source of energy for most ecosystems is the sun. Here's an illustration to help visualize:
The energy transfer between different levels in the ecosystem is not completely efficient, with some energy always lost as heat.