Weight gain is caused by an overconsumption of calories, barring a narrow range of medication side effects.
Insulin tells your body to uptake glucose into cellular bodies. If glycogen stores aren't depleted (in the liver from normal/basal metabolism, in muscular tissue from activity) and there's nowhere for it to go, it's converted via de novo lipogenesis and stored in adipose tissue. If there's no free room, new fat cells are created. Lipogenesis and the creation of new adipose tissue are not instantaneous processes.
Insulin resistance is because your body has continued to see that blood glucose is high because it cannot be taken up quickly enough, so it sends out more insulin. As high circulating levels become more normal, the alpha channel on the insulin receptor requires more insulin to activate a signal transduction pathway to open the GLUT4 transporter for glucose.
Very strictly, excess blood glucose causes insulin resistance. That excess blood glucose is caused by caloric overconsumption, which causes obesity. It is not the inverse.
Carbohydrates have poor satiety, so when the stomach is empty (fats and proteins have a longer processing time in the stomach), ghrelin is released, which stimulates hunger, and the person eats again. Probably more simple carbohydrates, possibly before the previous ones have been taken up by cells.
Caloric overconsumption -> obesity
Insulin resistance is a side effect here, one which is seen because simple carbohydrate consumption is part and parcel of obesity in the western world. It's very hard to become clinically obese without cheap sugar. The same mechanisms (overconsumption of calories) cause obesity and insulin resistance, so they're two sides of the same coin.