There is a common misconception that eating fat does not make you fat and that only carbohydrates make you fat.
This is completely wrong. You can get fat from eating fat.
If you’re sitting around all day eating carbs, the excess carbs do get stored as fat. I don’t deny that. However, if you’re sitting around all day eating fat (e.g. butter, coconut oil, etc), the excess fat gets stored as fat as well.
In fact, the study below shows that excess fat in your diet is stored as fat with greater efficiency than excess carbohydrates:
We overfed isoenergetic amounts (50% above energy requirements) of fat and carbohydrate (for 14 d each) to nine lean and seven obese men. A whole-room calorimeter was used to measure energy expenditure and nutrient oxidation on days 0, 1, 7, and 14 of each overfeeding period. From energy and nutrient balances (intake-expenditure) we estimated the amount and composition of energy stored. Carbohydrate overfeeding produced progressive increases in carbohydrate oxidation and total energy expenditure resulting in 75-85% of excess energy being stored. Alternatively, fat overfeeding had minimal effects on fat oxidation and total energy expenditure, leading to storage of 90-95% of excess energy. Excess dietary fat leads to greater fat accumulation than does excess dietary carbohydrate, and the difference was greatest early in the overfeeding period.