This stuff is fun, isn't it??
Without getting overly detailed...and of course, this is just what I am currently aware of. If they find something new in the labs between then and now, I file a disclaimer
A calorie is a calorie is a calorie to the body. It is true that you can eat more carbs than fats because gram for gram carbs are 4 calories versus 9 for fat, etc. but...most people would get full faster with fat than plain carb and so would consume fewer calories of the fat on their own.
The short answer is that a calorie is a calorie; the long answer is that because each of us is different, one person consuming 4,000 in one day can lose weight, another can gain weight while another maintains...regardless of what those calories are from.
Things like medications, hormones--thyroid, estrogen, etc., muscle mass, chronic illnesses (diabetes, etc.), activity level, pregnancy, etc. all play a role in how our body will use up the calories we consume.
And as has been well pointed out, certain foods offer nutritional value, antioxidants, etc. while others offer little more than calories alone.
Thoreau said, 'A man is rich in proportion to the things he can leave alone.'