The body distinguishes between fat, carbs and protein. There is a different physiological hormonal response to each of these macro nutrients. I.e, insulin primarily only responds to carbohydrates. So yeah, it's all about physics, but not every macro nutrient is treated the same. It's highly dependent on physiology. There's a maximum amount of energy in a calorie, obviously, but the body treats 100 calories of sucrose differently than 100 calories of fat and it mediates the bodies response through hormone and protein signaling. Look up mTOR for example. That's a protein that acts like a nutrient sensor that tells the cells which proteins it needs to generate, and it's primarily mediated through IGF-1 which is a response to dietary protein.