An ecosystem is a representation of harmonious relationship between biotic and abiotic components. It consists of food web, which represents the flow of matter and energy between different organisms. These organisms are divided into different trophic level, based on their food choices, as producers, primary consumers, secondary consumers, etc. An example is the ecosystem of grasslands, with grass at the producer level, deer at primary consumer level and tiger at secondary consumer level. In a balanced ecosystem, the population of producers needs to be the largest and that of the secondary (or top) consumers should be the least. This is because part of the energy is lost between different trophic level, understandably if a deer eats 10 kg of food, does not mean it is going to put on 10 kg of weight. Also, energy gets concentrated as we move up the trophic levels. Remember, herbivores spend most of their day eating, while top carnivores eat once every couple of days or so. Thus, we need many more producers than consumers.
Hope this helps.