According to a book I am reading, diet science currently agrees that there is one way to loose weight: A calorie deficit.
For example, if I need 2000 kcal a day and eat only 1500 kcal a day, I will loose some weight over the next weeks/months.
To my understanding, calories here are totally interchangeable, if we are only concerned with loosing weight (and ignore nutrients etc).
Calories are basically measured by burning food and measuring how much energy was set free.
My question is: Why and how does it work so good and why are calories interchangeable?
In more detail: Why can we translate the burning of calories with fire to processing the calories in food with our digestion system so perfect? Why is there no difference (concerning weight loss), if I eat 1500 calories as pure sugar or eat them as pure protein (where I would assume the body needs more energy to break down the protein)?
The others have put good descriptions of why calories are an accurate measurement for food energy.
However, you are absolutely correct that calories are not a perfect measurement, and different types of foods are not one to one replaceable. 1500 calories of sugar is NOT the same as 1500 calories of protein!
Burning the food produces a reasonable and useful approximation of the available energy.
Does the human body burn food? Of course not. We transform food into useful components and then pump them around the body to be used by cells.
If you eat 1500 calories of protein, your body will use some of those calories simply as proteins, rather than breaking them down into energy (via sugar). Which means you will have less food-energy in your system and are more likely to run a deficit.
Again with protein, the transformation of protein into sugars which can be used as energy takes energy, so you end up with a smaller amount of calories actually being available.
TL;DR Calories are not perfectly interchangeable. However, they are our best, and most useful, quick way of approximating energy intake from food.
Thank you for your answer!