Food is a system of energy transfer. The main source is the sun (other than a few interesting Chemosynthesis creatures), and then its all a matter of how many steps away from the sun your meal is.
For instance if you are a plant its pretty straight forward,
(sun -> you)
If you are a cow,
(sun -> plant -> you)
If you are a wolf,
(sun -> plant -> deer -> you)
Being a human (assuming you ARE a human) it can get really interesting depending on how you get your food, but lets simplify:
carnivore (meat only) = (sun -> plant -> animal -> you)
omnivore = [(sun -> plant -> you) + (sun -> plant -> animal -> you)]
vegetarian = [(sun -> plant -> you) + (sun -> plant -> egg/cheese – >you]
vegan (plants only) = (sun -> plant -> you)
So like any energy transfer system a little bit is lost at each stage. The plant absorbs the sun and wastes some of it growing, and when we the cow eats the plant it wasts some of it growing and so on until it gets to your mouth. That means it takes more energy to produce X number of cow calories than it does X number of vegetable calories.