Hi emwell2,
It can feel pretty tough being put on the spot like that with such a personal question. Just tell them:
"There's not really a specific reason, it can happen to anyone."
OR
"My brain has a chemical imbalance."
OR
"I rather not answer such a personal question."
OR
"I'm depressed because people ask me stupid questions."...
Don't ever feel compelled to answer questions you don't want to though. But also just remember that people can be quite ignorant on things like mental health, so try not to take it personally if people ask you why, and/or don't understand your answer.