The sun is the start for the flow of energy through the ecosystem. Producers such as plants continue that flow and provide energy for other organisms. Herbivores such as impala will then eat the plants to gain energy, then consumers such as leopards will eat the impala to gain energy. Hope that helps. :)