The ecosystem is the living and non-living components of an environment functioning as an interconnected system.