Yes, "thermodynamics". But we are not a simple furnace (which is by the way the very thing used to calculate the calories in food. A furnace). We are a complex machine with thousands of chemical pathways, feedback loops, some more efficient than others. You do not eat pure energy, you eat organic matter that is chemically turned into multiple forms of energy.
Nothing has been a better ally to the obesity epidemic than CICO (calories in, calories out)