Fats contain more hydrogen and carbon than carbohydrates. Look at the picture below of the carbohydrate. Notice all the oxygen atoms?
Now look at the picture below of a triglyceride, or basically fat. Notice all the carbon and hydrogen atoms?
Carbon and hydrogen can be reduced, or can lose electrons, by oxygen through oxidization. Hence, fuels like gasoline or natural gas are mostly hydrogen and carbon. The oxygen in carbohydrates cannot be reduced, but instead contribute to the oxygen used to reduce carbon and hydrogen. Thus, the oxygen in carbs and triglycerides are worthless.
This is the same reason why ethanol, a renewable alternative to gasoline, is less powerful than gasoline. Ethanol is an alcohol, so it contains an oxygen atom within its molecule. Gasoline is mostly alkanes, alkenes, and alkynes, all of which do not have oxygen within their formulas.
If you wish to learn more on this subject, I would suggest learning more on oxidation and reduction, and on thermochemistry.