If we have a diet containing plenty of carbohydrate, the carbohydrate goes into the blood as sugar. There are very few chemical reactions along the way, and there is a loss of energy to the universe with each of these reactions. But, since there aren't many conversions, there isn't a lot of energy loss.
If we have no carbohydrates (or few) in the diet, however, it's a different story. In order to maintain the necessary sugar level in the blood the body is forced to make sugar out of protein, which isn't a simple operation. Look in any basic biochemistry textbook and you can see all the reactions required to convert protein to sugar, and each one of these reactions consumes energy just to take place but loses energy to the universe in the process as well. It's much less efficient for the body to convert protein to sugar than it is to simply take the sugar as it comes in already formed.
The second law of thermodynamics virtually mandates that there be a larger loss of energy when one has to convert protein to sugar instead of merely using the sugar as it comes in. Since there are 4 kcal of energy in a gram of sugar and 4 kcal of energy in a gram of protein, it should be apparent that less of the 4 kcal in a gram of sugar will be dissipated than will be the 4 kcal in a gram of protein if this gram of protein has to first be converted to sugar.
And, consequently, one would think that a diet low in carbohydrate and higher in protein and fat (both of which have to be converted to sugar) would bring about a greater weight loss than a diet of the same number of calories but with higher levels of carbohydrate. In fact, the second law of thermodynamics predicts this very phenomenon. But despite this rather obvious notion that complies perfectly with the second law, many ignorant people continue to cling to the idea that 'a calorie is a calorie' despite that idea flying in the face of the second law.