The ecosystem consists of a flow of energy that unidirectional and there is always a decrease in the amount of energy when it's transferred from one place to another.
Such as in the food chain there is a transfer of 10% amount of energy which is used by the various organisms and 90% of energy is lost between the tropic levels in form of heat and respiration.