The number of calories in a food is a measure of how much potential energy that food possesses. A gram of carbohydrates has 4 calories, a gram of protein has 4 calories, and a gram of fat has 9 calories. Foods are a compilation of these three building blocks. So if you know how many carbohydrates, fats and proteins are in any given food, you know how many calories, or how much energy, that food contains.
If we look at the nutritional label on the back of a packet of maple-and-brown-sugar oatmeal, we find that it has 160 calories. This means that if we were to pour this oatmeal into a dish, set the oatmeal on fire and get it to burn completely (which is actually pretty tricky), the reaction would produce 160 kilocalories (remember: food calories are kilocalories) -- enough energy to raise the temperature of 160 kilograms of water 1 degree Celsius. If we look closer at the nutritional label, we see that our oatmeal has 2 grams of fat, 4 grams of protein and 32 grams of carbohydrates, producing a total of 162 calories (apparently, food manufacturers like to round down). Of these 162 calories, 18 come from fat (9 cal x 2 g), 16 come from protein (4 cal x 4 g) and 128 come from carbohydrates (4 cal x 32 g).
Our bodies "burn" the calories in the oatmeal through metabolic processes, by which enzymes break the carbohydrates into glucose and other sugars, the fats into glycerol and fatty acids and the proteins into amino acids (see How Food Works for details). These molecules are then transported through the bloodstream to the cells, where they are either absorbed for immediate use or sent on to the final stage of metabolism in which they are reacted with oxygen to release their stored energy.
Click here for a simplified diagram of these metabolic processes.