The living organisms of an ecosystem are related through food chains, which gives rise to trophic levels in an ecosystem. There is a flow of energy from one trophic level to the other in a food chain. Producers bring energy from the sun into the community. Primary consumers eat the producers, which makes them herbivores in most communities. Secondary consumers eat the primary consumers, which makes them carnivores. Tertiary consumers eat the secondary consumers. A final link in the food chain are decomposers, which break down the organic matter of the tertiary consumers (or whichever consumer is at the top of the chain) and release nutrients into the soil. Thus, there is flow of energy from Sun ------> Producer ------> Herbivore -------> Carnivore ------> Decomposers.