The simple way to explain calories in food is that a calorie is a measure of heat. Total calories for food is measured by the amount of heat it takes to consume or burn off food. It is typically measured in a sealed oven where total heat can be easily measured and convereted to Calories.
By the rate that energy in the food is stored. Carbon molecules holding kilo-calories, or thousand numbered covalent bonds, are measured by the rate they are broken down.
Proteins, fats and carbohydrates are the main source of energy that the body uses. Their fuel equivalant, expressed in calories, means the amount of energy that may be released as heat when food is metabolized.