Energy exists in many forms and is transferred between organisms through food webs and chains. Autotrophs like plants capture energy from sunlight through photosynthesis and are eaten by herbivores, while carnivores eat other animals and omnivores eat both plants and animals. Energy and matter are recycled through ecosystems in cycles like the water, carbon, nitrogen, and oxygen cycles which transform molecules like carbon, water, nitrogen, and oxygen between living and nonliving matter.