Matter and energy in living systems
Food is broken down and absorbed, then respiration in the cells releases its stored energy, which is measured in kilocalories.
A worked example
A serving with 20 g of carbohydrate, 10 g of protein and 5 g of fat supplies 20 x 4 + 10 x 4 + 5 x 9 = 165 kcal.
The mistake people actually make
Fat carries about 9 kcal per gram against 4 for protein and carbohydrate, so the heaviest serving is not always the highest in energy. Digestion breaks food down; absorption is the separate step of getting it into the blood.