In an ecosystem, plants capture the sun's energy and use it to convert inorganic compounds into energy-rich organic compounds. This process of using the sun's energy to convert minerals (such as magnesium or nitrogen) in the soil into green leaves, or carrots, or strawberries, is called photosynthesis.
Photosynthesis is only the beginning of a chain of energy conversions. There are many types of animals that will eat the products of the photosynthesis process. Examples are deer eating shrub leaves, rabbits eating carrots, or worms eating grass. When these animals eat these plant products, food energy and organic compounds are transferred from the plants to the animals. These animals are in turn eaten by other animals, again transferring energy and organic compounds from one animal to another. Examples would be lions eating zebras, foxes eating rabbits, or birds eating worms.
This chain of energy transferring from one species to another can continue several more times, but it eventually ends. It ends with the dead animals that are broken down and used as food or nutrition by bacteria and fungi. As these organisms, referred to as decomposers, feed from the dead animals, they break down the complex organic compounds into simple nutrients. Decomposers play a very important role in this world because they take care of breaking down (cleaning) many dead material. There are more than 100,000 different types of decomposer organisms! These simpler nutrients are returned to the soil and can be used again by plants. The energy transformation chain starts all over again.
Producers: Organisms, such as plants, that produce their own food are called autotrophs. The autotrophs, as mentioned before, convert inorganic compounds into organic compounds. They are called producers because all of the species of the ecosystem depend on them.
Consumers: All the organisms that can not make their own food (and need producers)