Calories have something to do with it because they are one part of the equation. Calories in does equal calories out. Calories In = Calories Stored + Calories Expended. But, the mistake is in thinking that the law of thermodynamics means that the type of calories in doesn't impact the ratio of calories stored/expended -- the variables are not independent. The content of the food you eat impacts: your hunger, your energy level, fat storage rates, and your metabolic rate, all of which mean that attempting to cut or add calories may not have the expected impact depending on what the food is.
The reason sometimes we put too much emphasis on the basic-thermodynamics side of things is that we're busy fighting a war against dumb fad diets.
But once you acknowledge the basic calories in vs calories out principle, you can start thinking about what foods make it easiest to maintain a caloric deficit. Even the most 'traditional' of health authorities acknowledge that this is a factor, which is why they won't say "Hey, whatever, eat three slices of chocolate cake a day and nothing else". The first factor is making sure you get sufficient nutrition along with your calories, the second is making sure you feel full while maintaining a caloric deficit. There's a growing acknowledgement that low-carb diets can help with both of these.
This study suggests a third factor: that eating a low-carb diet can actually boost your base metabolic rate. How? Not sure. It would be interesting to see whether it gets replicated in a larger scale study.
To quote Gary Taubes, who tries to puncture this myth:
The reason people believe we get fat because of overeating and sedentary behavior is because they believe the laws of thermodynamics somehow dictate this to be true. In particular the first law, which tells us that energy is conserved, so if a system takes in more energy than it expends, the energy contained in the system has to increase. If that system happens to be our fat tissue, than the fat tissue accumulates fat. That’s the logic. So if we eat more than we expend, we get fatter and the logic turns this around to say that we get fat because we eat more than we expend. And so, overeating and sedentary behavior are the causes. This is the logic that leads virtually every government health agency and independent health organization (the AHA, the AMA, you name it) to have some variation of this World Health Organization statement on its website or in its promotional material: “The fundamental cause of obesity and overweight is an energy imbalance between calories consumed on one hand, and calories expended on the other hand.”