Does overeating have to be caused by mental illness?

Not necessarily. Binge eating can be caused by psychological disorders such as binge eating disorder, bulimia nervosa and anorexia nervosa, but metabolic disorders such as diabetes mellitus and hyperthyroidism, as well as normal people when faced with irresistible food, can also experience binge eating.