Fat, along with protein and carbohydrates are macro nutrients, or a substance that provides energy. When you're consuming more calories than you are expending, you might see weight gain. And that may come from protein, carbohydrates, or fat. Also, there can be an underlying health condition that may cause weight gain and your ability to shed weight.
Fat is awesome -- so you do your thing and eat some egg yokes and get YOKED!
Here's a list of some very awesome, healthy fats:
-Sustainable raised animal products
(yay for a superrrrr condensed version of how shit works when it comes to fats...!)