There are two trophic levels in an ecosystem, namely the autotrophs and the heterotroophs. In simple terms, there are two sets of members placed in an ecosystem based on their modes of energy production. Autotrophs are those that produce energy from sunlight and inorganic material, while the heterotrophs are those that produce energy upon processing organic matter.
Plants and some bacteria form the autotrophic level. They are the prime energy producers in a food chain. While plants produce their energy by the process of photosynthesis, bacteria produce their energy as a result of inorganic chemical reactions. Water and carbon dioxide along with 673,000 calories per mole of sunlight power when processed in the chlorophyll of plants produces the energy that plants possess. Glucose is a result of photosynthesis which when consumed by the higher order members of the food chain, becomes a vital source of energy. The by-product of photosynthesis in plants is oxygen, which is released through the stomata of plants into the atmosphere. Plants that produce energy by the process of photosynthesis are called phototrophs. These members also use nutrients and nitrogen compounds in the soil to produce energy rich organic compounds such as aminoacids, proteins, carbohydrates, etcetera, through the process of nitrogen fixation.
Some bacteria, which form the second group of members in the autotrophs produce their energy as a result of 'inorganic' chemical reactions. They break down inorganic matter in the air or soil to generate their energy. Such autotrophic members are known as chemoautotrophs. Thus it can be seen that the autotrophs consisting of the phototrophs and chemoautotrophs form an important base in the food chain. Without these members, the entire ecosystem structure collapses as the consumers are dependent on these energy producers.
Heterotrophs on the other hand cannot produce their own energy for inorganic matter. They are called consumers as they consume the pre-generated energy from the producers which is in the form of organic matter to maintain their growth and basic sustenance. Based on their mode of consumption, heterotrophs can be classified as:
Herbivores - consumers which directly feed on the producers and form immediate higher levels in the food chain, from plants
Carnivores - consumers which feed on other consumers / animals in the food chain and are not directly linked to the autotrophs
Omnivores - consumers which feed on both autotrophs and heterotrophs
Saprobes - consumers that get their energy by feeding on dead or decaying matter
While both require sunlight and water to live, autotrophs differ from heterotrophs in obtaining energy based on their energy synthesizing ability. Most autotrophs contain the green pigment chlorophyll which helps in photosynthesis, while the heterotrophs lack this main energy ingredient and hence becomes their dependent.
In simple understanding, the autotrophs convert simple inorganic compounds to form complex compounds, while the heterotophs have the ability to break down and use these complex compound for various life processes. While one differs from the other, both have an equally important place in the food pyramid of an ecosystem.