The amount of calories someone consumes is just one side of the coin - you have to consider how many of those calories they are actually expending.
The most visible element of that is the amount of activity the person is doing - exercise for example. Imagine two otherwise identical people (Alex and Bob) who have both consumed say 2000 calories. Alex spends the rest of the day after eating sitting on the couch enjoying old episodes of Rick and Morty on Netflix (Keep Summer safe!) whereas Bob went out and ran a marathon, helped their elderly neighbor move their living room furniture around (Bob's a good guy or "sucker" depending on your perspective!) and then cycled 5km to the shop for cat food. Now who's going to have more calories available for storing in body fat - Alex or Bob?
They've both consumed the same amount of calories but Bob has burned more of those off then Alex.
Now you're no doubt thinking to yourself "well that's obvious - but I've seen Charlie and Derek who both spent the afternoon watching Netflix but Charlie is obese and Derek is a stick insect, what gives?"
Well that's because the majority (~ 70%) of our calorie burning is actually done by the basic processes of keeping the body running. This is called the Basal Metabolic Rate (BMR) and this varies between different individuals and while some of the factors dictating this difference have been identified and understood we don't have a complete understanding of it yet.
Additionally not only are we humans not all the same - not all calories are either. Different foods might have the same numeric calorie values but depending on how they are made up (fats, sugars, carbohydrates etc) the body will digest and process them differently and this can effect body fat levels. A person eating a diet high in saturated fats will gain fat faster than someone eating the same amount of calories from Low-GI sources.
So just looking at the amount of calories people consume is insufficient to fully answer the question of why some people are obese and some aren't.