Diet plays a significant role in weight gain. Consuming high-calorie foods, sugary drinks, and processed foods can lead to an excess calorie intake, resulting in weight gain over time.