Dieting (and dieting harder even more so) causes serotonin levels to plummet, leaving you at risk for everything that follows out of that (feeling sad, mad, anxious, negative body image, ...)
The main reason (the other being to handle all the drugs' direct effects, think of what say Tren or Clen do to you and you can see the link to a serotonergic antidepressant) why many bodybuilders turn to serotonergic antidepressants when dieting or preparing for shows.
What obviously doesn't help is the low or even worse in this regard, no carb diets. Your brain needs carbs to synthesize serotonin, period. The more you eliminate them from your diet, the more you put yourself at risk for all of the above.
Not a fun truth to be aware of but the truth regardless.