Answer:
The flow of energy is determined by the process which is known as photosynthesis. This is because only producers have the capability to make food.
The food from the plants are transferred to the animals, primary consumers. The food from the primary consumers are transferred to the secondary consumers.
From there it gets transferred to the tertiary consumers. This is how photosynthesis maintains the flow of energy in an ecosystem.