So has it been studied? Are there popular theories on what the mechanics behind depression are? I would be curious to know these.
Both, headaches and depression to me seem to have been "intentionally" developed by evolution. Pain has a reason: Tell you to not do certain things. Low energy / self esteem might also have a reason: Tell you to stay at home.
A broken leg on the other hand was not developed for a reason by evolution.