Psychologists think they’ve found the purpose of depression