Food is the source of energy for an organism. In an ecosystem, organisms of higher levels consume organisms of lower levels to obtain energy.
When an organism consumes another, the energy is transferred. Thus, from producers to the tertiary consumer (from the first trophic level to last) the energy flow occurs. It is linear in nature.
Hence, the transfer of energy from one trophic level to another is called the flow of energy in the ecosystem.