One way to view mental illness is through the mental model of Buddhism and Daoism. This mental model is the basis for meditation in taekwondo (See here and here), as well as karate, Shaolin gongfu, Muay Thai, taiji, bagua, and xingyi.
In the Buddhist and Daoist view, the mind comprises two distinct components:
- emotional mind - produces emotions such as anger, sadness, jealousy and associated thoughts
- wisdom mind - directs intention
Part of meditation training is to observe the thought process. Experiencing the emotion of anger often leads to thoughts such "He/she is mean", "it's not fair", and "I should get back at them by xyz". This causation is not imperative; using your wisdom mind you can train your emotional mind to experience emotion independent of these thoughts.
One way to start this process is to closed your eyes to reduce distractions and focus your intent (wisdom mind) on abdominal breathing that is quiet, relaxed, continuous, deep, and even. By focusing on breathing, you should notice that other thoughts enter your mind less frequently. Focusing thought on one thing (breathing) to prevent thoughts about many other things is colorfully referred to as "distracting the monkey with a banana". Over sustained practice, you reduce distracted thought and can separate the experience of your emotions from the thoughts they normally trigger.
Young children express their emotions without inhibition. Most adults learn to suppress their responses to emotions ("bottle up their emotions"), but not necessarily to stop the formation of negative thoughts. Meditation training is supposed to train this.
One goal of martial meditation training is to achieve mushin, a state of no-mindedness where thought is stopped.
Mental illness, as described in your question (which does not include things like psychosis), can be viewed as a state where the emotional mind forms chains of uncontrolled, unproductive thoughts. These thoughts and resulting emotions may be debilitating, enervating, and lead to counterproductive behavior. A stimulus that most people consider unremarkable may trigger the memory and mental experience of trauma.