The calorie labeling system is not meant to measure the thermal content of food — it is intended to tell us something about the energy content available to our bodies.
For example, the bomb calorimeter would tell us that the average number of calories in one gram of protein is 5.65, but we use a value of 4.2 (usually rounded down to 4) based on our understanding of human digestion and the metabolic pathways our bodies use. For years, we thought these estimates were good enough to serve the purpose of nutritional labeling. But modern studies show us that these estimates are inaccurate and this understanding is incomplete. Even worse, the inaccuracies aren’t random but appear to be systematic: they are reasonably accurate for processed food but consistently overestimate the calories in whole food.