A food chain ends when there is insufficient energy in the last level to sustain an additional predator. The productivity of the base of the food chain. The presence of ectotherms in the food chain lengthen the food chain, endotherms will shorten the chain. Large predators such as lions shorten a food chain. Parallel grazing and detrital food chains.
Energy can cycle through from dead to living but loss to heat occurs at each step.
But finally all energy leaves the food chain. True decomposers are bacteria and fungi which excrete digestive enzymes into the environment and take up the resulting digested material.