I find the way we measure calories very interesting: place the food in a metal box filled with oxygen, immerse the box in water, make the food explode so that it combusts completely, and finally measure how much the water heats up.
Rather crude and fun, but that's it, see Bomb Calorimeter. I guess it makes sense in retrospect, how else would you do it?
They usually just measure standard basic ingredients, then you roughly match them to your recipe and add it up. No wonder food labelling is just a ballpark.
I think it is an interesting and underappreciated aspect of calorie counting as well. I think calories are a decent first order approximation for foods that humans (and animals) evolved eating, because we are efficient extracting chemical energy.
The alternative would be empirical animal studies that look directly at weight as a function of feed. You will note that agribusiness doesn't mess around with calories when money is on the line. Instead relies on empirical data for mass as a function of feed type.
I'm not convinced calorimetry is particularly useful for any nuanced diet planning.
We can't eat wood (or coal) but they're very calorific when measured via bomb calorimetry.