Plants are producers that make their own food through photosynthesis. Energy and nutrients are transferred as herbivores eat plants, and as carnivores consume herbivores and other carnivores, forming a food chain. A food web shows how different food chains interconnect as organisms fill different roles as producers, primary consumers, secondary consumers, tertiary consumers, omnivores, or decomposers to cycle energy and matter in an ecosystem.