Not "purge" but rather "starve" or "transform" or even better "disrupt" standard chemical pathways.
As many emotions depend on dopamine, serotonin, oxytocin and endorphins, starving/fasting kicks in the primary mode of operation and reduces disbalance caused by excess amount of nutrients...
For instance there is a link between diabetes and depression https://archive.ph/f50wd
...