GAINING FAT and why it actually happens
There are a lot of claims nowadays about what actually causes fat gain. Some think it's too many carbs, others think it's too much fat. However, there is plenty of research to show that this isn't the case and that the main drivers of body fat accumulation is down to energy intake exceeding energy expenditure. In other words, eating more and not burning enough.
There is no particular type of food that will make you gain fat directly, even if it's high in sugar or processed. When you consume more energy (i.e. calories) than your body needs to fuel your active daily living and physical activity, it will store the excess energy mostly as fat.
The reason we tend to gain more fat once we eat a lot of junk or processed foods, is that they're highly palatable, so once you eat foods that are tasty, high in calories, and not filling, you'll easily consume too many calories.
Although balancing your energy in and energy out will ultimately be the key to controlling fat gain, food choices are still important for fat loss since it can affect your caloric intake. I always suggest to my clients and anyone wanting to know that your diet should consist of 80-85% whole, nutritious foods. This will allow you to have some treats while keeping an overall wholesome diet.