Whenever a consumer eats something, a certain amount of the available energy from the food item passes to the consumer, but not all of the energy in that food item is accessible to the consumer.
The image below shows a visual of energy transfer and how it is broken down. As you can see, the primary consumer does not have all of the energy from the plant available to it. Only the green stored energy is available to the consumer.
Thus, a primary consumer is going to be more efficient than a secondary consumer. A secondary consumer is going to be more efficient than a tertiary consumer.
In the image below, the ground squirrel consumes the plant but then the fox consumes the squirrel. The fox is less energy efficient than the squirrel because the squirrel consumes all of the plant's stored energy, but by the time the fox consumes the squirrel, some of that original energy from the plant has been lost (the squirrel has wasted some of it and some has been used). Thus, the fox accesses only the stored energy of the squirrel, which is less energy than the stored energy of the original plant.
Primary producers (the plant in the first image) harvest their energy from the sun. When energy goes from one level in the food chain to the next, anywhere between 5-20% of the energy from the previous level is transferred. Meaning that the lower one goes in the food chain, the more of that original energy (from the sun) is used.
Whether 5% of the energy is transferred or 20% depends on the environment, the quality of the food item actually being consumed, and other factors. 10% is often used in diagrams for an average.
To learn more, check out this site .