Genetics can play part of a role in it. This article is great if you want to know more about it (so is the Metabolic Rate Overview on the same site):
"However, Not Everybody Has it as Easy as Everybody Else
The research, however, is very clear: not everybody has it as easy as some folks do. Some people’s bodies are, in fact, demonstrably more resistant to weight loss (or gain) than others. Not that they can’t lose (or gain) weight but it comes off or on more slowly. More accurately, their bodies fight back harder.
Researchers call these folks Diet Resistant and the reasons behind this resistance is just starting to be determined. It probably has to do with how these individuals brains perceive changes in caloric intake which determines how their brains react to those changes. Some people’s bodies simply increase metabolic rate more quickly (or drop it more quickly) in response to increased or decreased calories. You can see similar variations in terms of what’s lost during dieting; given the same diet and exercise program, some people will lose a lot more muscle than another.
And we all have that one friend who eats nothing but ice cream and soda and never gains a pound. Of course, when you look closely, you find that the person really isn’t eating as much as it looks like overall, or they are only eating that one big meal per day that you happened to see, or they are burning it off because they are constantly moving (in essence, they fidget the excess calories off), or they compensate the next day after eating a lot and eat very little so that overall they maintain their weight.
These people’s brains sense the caloric excess more readily and either blunt hunger harder and faster, or get the person to move more, to burn it off. The same thing happens in reverse, some people’s metabolic rates slow down faster when calories are restricted, or makes them move around less during the day so they burn fewer calories, making further fat loss a lot harder. You can learn everything you ever wanted to know about this by reading the article Metabolic Rate Overview.
So there is no doubt that there are individual differences and efficiencies between people, that probably explains why you can find one person who reports near-magical results with nearly every diet out there: they happened to hit the one that just ‘fit’ their individual metabolism and chemistry. It would be silly to ignore all of that and I do hate being silly.
But that doesn’t change the fundamental rules of thermodynamics which apply to everybody and everything. Given 100 calories, the most you can store is 100 calories. Sure, one person may only store 75, while another stores all 100, but 100 is still the maximum. It’s a physiological impossibility to store more than you actually ate because you can’t make something out of nothing. There’s lots of things like this, that you simply can’t do. You can’t make gold out of lead, you can’t find an honest politician, and you can’t store 500 calories if you only ate 300.
So when a 300 pound individual, who probably has a maintenance intake of 4000+ calories, says that they gained weight on 1400 calories I have to be very leery of how true that is. Either they are that 1 in 100,000 person with a metabolic rate below 1400 at that bodyweight (who has never been found to exist in any study on the topic over a span of about 5+ decades), or they aren’t being accurate in how much food they are eating or how many calories they are burning each day. You can probably guess which one I think it is. And, so we’re clear, I’m not saying that they are deliberately lying, either, I want to make that very clear. They are just as bad as everybody else at estimating their caloric intake and expenditure. Which is apparently pretty bad.
Which is why you can’t magically gain weight on 1000 calories per day if your maintenance intake is 2000 calories per day. Either your body will mobilize stored fuels, or it will slow down metabolic rate to 1000 to put you back into balance (and no study has ever shown the latter to occur in the absence of rather massive weight loss). Something has to happen. But weight gain on sub-maintenance calories isn’t one of them.
It’s also why you can’t not gain weight on 3000 calories per day if your metabolic rate is only 2000 calories per day. Either you start storing fuel or your body is speeding up metabolic rate to compensate. Something has to happen."