Plants capture energy from the sun; something eats the plants; something eats that; and so on up the chain. In principle there's no obvious reason that chain couldn't run for a dozen links. In practice, it almost never gets much past four or five, and the reason comes down to a strikingly leaky transfer of energy at every single step: on average, only around ten percent of the energy available at one trophic level actually makes it into the bodies of whatever eats at the level above it.
Where the other 90% goes
An organism spends most of the energy it takes in just staying alive — cellular respiration, movement, and for warm-blooded animals, a substantial ongoing cost simply to maintain body temperature. A further share of what's eaten is never even digested or absorbed at all, passing straight through as waste. What's left over, after all of that, is the fraction that actually becomes new body tissue — new biomass — and that remaining sliver is the only part available to whatever eats this organism next. It's a small slice of what came in.
Why this caps how long a food chain can get
Because each level keeps roughly a tenth of the energy of the level below it, the total energy available shrinks fast, and multiplicatively, at every step. If primary producers capture some baseline amount of energy, primary consumers have access to roughly a tenth of that; secondary consumers get roughly a tenth of that again; and so on. After four or five steps, what's left is often too thin to support a viable population of anything above it — which is the deeper reason apex predators tend to be relatively rare, need large ranges to find enough food, and sit atop food chains that almost never stretch much beyond five or six links, no matter the ecosystem.
What we're still unsure about
The "ten percent" figure is a widely cited rule of thumb, not a fixed law of nature. Actual transfer efficiency varies meaningfully by ecosystem and by the organisms involved — some studies have measured efficiencies anywhere from under five percent to over twenty percent, depending on factors like whether the animals involved are warm- or cold-blooded, since warm-blooded animals burn far more energy simply maintaining body heat. Ecologists still debate how far any single number should be generalised across very different kinds of food webs, since a marine plankton-based system and a terrestrial grassland system don't necessarily behave the same way, rather than treating ten percent as a universal constant that applies everywhere equally.
This sits inside Energy Flow & Trophic Levels, one of seven topics in Ecology, one of six domains in Biology, one of seventeen subjects the app can quiz you on.