It may not be that deterministic, as if it's either diet or social context. One thing can feed on the other.
It can start as an emotional response, deflagrating an inflammatory process, revealing the nutritional deficiency. Or it can start with a nutritional deficiency, deflagrating an inflammatory process, which the brains reads as depression.
This mechanism is already seen regarding stress and magnesium. High stress -> Mg depletion. Low Mg -> Stress symptoms.
It can start as an emotional response, deflagrating an inflammatory process, revealing the nutritional deficiency. Or it can start with a nutritional deficiency, deflagrating an inflammatory process, which the brains reads as depression.
This mechanism is already seen regarding stress and magnesium. High stress -> Mg depletion. Low Mg -> Stress symptoms.