This is the hard thing about the "calories in/calories out" statement, it's accurate for a specific thing: the calories of energy in a burnable form available to your body/the direct burned calories as a combination of RMR and exertion.
The issue of course is that we use it in the context of different kinds of food and a simplistic assumption about how effective we are at converting a calorie in each into a burnable form.
2000 calories of energy from custard will be processed, stored and used differently than 2000 calories of energy from chicken.