"the only diets that work, work because you take in fewer calories than you burn."
Yes, but how many calories do you burn?
It's determined by your metabolism, which is influenced by what you eat. It's not a simple equation.
And, how many calories do you "take in" when consuming a unit of food? As another poster pointed out it depends on the unique characteristics of your body. Also influenced by what you eat.