With depression, not only appetite is lost, sleep and physical activity are disturbed, that is, the physiological needs of the body are reduced. It is associated with serotonin ("the hormone of happiness"), norepinephrine, dopamine. Since serotonin plays an important role in the regulation of motility and secretion in the gastrointestinal tract, increasing its peristalsis and secretory activity, a decrease in its production and causes loss of appetite.
It's simple. Our emotions are essentially reactions to certain hormones (their presence or absence). When a person eats, in most cases (! But not always), pleasure hormones are released, that is, the body reacts positively. In the course of our life, we acquire various reflexes. Consequently, many people have a positive reaction to food. Depression itself means that the human body does not (rarely) or is present, but in small amounts, the hormones of "happiness".
From the above, we can conclude that a positive reflex to food will not work, if a person is depressed, and nutrition loses all its importance, because it turns from a "high" into a need.
In short, all problems are due to the brain.