Your body temperature goes up and down, changing how much energy is spent by body. Your ability to perform goes up and down - you become sleepy and tired, your brain spends less energy and that is that (yes it has impact on your attention and performance). You cant stop it from happening. You may try to exercise the same and can easily become unable to.
Your body gets rid of calories in poo and piss, when sweating or not.
Your body can just turn off functions and generally malfunctions and you dont have direct control over it.
If we looked at total energy of your gasoline we'd need to consider mass to energy conversion as well... but your body can't do that either. Energy your body can metabolize is clearly a subset of total energy available. It's certainly an estimate and it's not perfect but it's useful.
This looks like a digestible introductory guide: https://themedicalbiochemistrypage.org/digestion-and-digesti...
And a brief description of how all that helps inform calorie counts on nutrition labels: https://en.m.wikipedia.org/wiki/Atwater_system
People make entire career studying these sort of processes. Over time the information is refined. All of this ultimately helps inform how we measure and quantify things like calorie counts on food labels. Again, not perfect, but the process works and improves over time. It's a complex macroscopic system relative to the underlying chemistry and physics but if we assume larger systems are built on, composed, and governed by principles of constituent systems then we have a way of slowly understanding these complex processes and using that knowledge to our advantage.
Just as with software systems we rely on abstract processes below us to talk about things. That doesn't mean the high level abstractions are ignoring the details, it's just that there's value in talking about things simplistically like "calories in" and "calories out" without people looking to take very literal interpretations and trying to convert total energy possible into kcals. Heck, this is why they're "Calories" and not "calories" and why "Cal" has even been proposed to help avoid this sort of confusion.