A calorie is a unit of energy and expresses the amount of energy in the form of heat required to raise the temperature of 1 g of water by
Likewise, a kilocalorie represents how much heat is required to taise the temperature of 1 kg of water by
So, this is how you'd determine how many kilocalories a certain food item has. The most basic way of determining a food's nutritional value is by determining how much energy is released when the food sample undergoes combustion (is burned).
The amount of heat released during the combustion of a food item will be equal to the amount of heat absorbed by the water that surrounds the combustion chamber (often called a bomb). The temperature change measured for the water will then be used to determine exactly how much heat was given off.
Let's say you want to know how many kilocalories are in a 83 g of hamburger meat. You'd place the sample in the bomb, ignite it using a current (that is what the two electrodes are for), and measure by how much the temperature of the water changed.
The initial temperature of the water is room temperature, or
You know that 1 kilocalorie must raise the temperature of 1 kg of water by 1 degree Celsius, so
So, to answer your question, the kilocalories usually cited on food labels are not exactly the values obtained by using this method.
This happens because the numbers obtained through combustion in a bomb calorimeter represent the gross energy value for a food, and do not take into account the net energy value they have for humans.
We cannot derive all of the energy that can obtained through combustion in a calorimeter from the food we eat. For example, proteins are listed as having 4 kilocalories per gram. However, the energy derived by using the bomb calorimeter method is actually 5.65 kilocalories per gram.
The values listed on food labels represent the average caloric content for a particular food item, but are nonetheless relatively close to what you would obtain in a bomb calorimeter experiment.
Here's a nice video on this topic: