The main fats in coconut oil (~65%) are medium chain triglycerides (MCTs). As you can probably tell by the name, these fats have a medium chain length. In contrast, about 98% of fats in the typical Western diet are long chain (LCTs).
MCTs are absorbed easily into the blood stream and used immediately for energy while, in the presence of carbohydrates, LCTs are unlikely to be used for energy and are more likely to be stored as fat. MCTs provide an immediate source of energy.
Human and animal studies have shown that when MCTs are eaten in place of LCTs, there is less weight gain for the same fat (and energy) intake.