I think there are at least three key reasons for the increased prevalence of mental illness in gifted people. Note that this is my personal take on the question—I don’t know if this is what mental health professionals believe. It’s tricky to study and share information about this kind of stuff, since people have a right to privacy, it’s hard to get accurate empirical data from humans, and we’re talking about a relatively small population.
First, think about some different machines. The more complex machines are often the easiest to break. The brains of gifted people aren’t particularly different from the brains of other people, although there are some studies on percentage of grey matter and the thickness of certain areas during development. But they could arguably be described as more complex. Another way to think of this is that the more bells and whistles your brain has, the more things that could be affected by psychological trauma.
One model of memory, the one advanced by Piaget, groups our individual thoughts and memories like a cluster map. This idea is so widespread people use cluster mapping as a brainstorming activity. The clustering gives you a way to access information by running through a relay from thought a to thought b to thought c, and so forth. You can also use it to illustrate how concepts bridge together in your mind. Psychological trauma could damage those connections, but it seems more likely to me that trauma could “wall off” particular elements in the map. The end result would be the same. So it could be that highly intelligent people are more susceptible to mental trauma because their minds have more clusters and connections in them to disrupt.
Second, consider how the world has become more complicated over the past five hundred years. Gifted people are better with complexity, and are therefore more aware of the world. We are living in a time of great political complexity—hypocrisy and corruption seem to govern the modern political age. Our ability to understand what is going on is thwarted by closed governments, misinformation, and sealed intelligence reports such that it takes a serious investment of thought and work to understand them. Corporate malfeasance in the past half century has resulted in companies keeping more of their profits for their shareholders and less of their profits for their employees, despite clear evidence that employee productivity and employee pay had been linked for centuries before hand. Gifted people recognize and remember these facts, and have a stronger understanding of the scope of some of these problems. In other words, they are smart enough to know how bad things could be.
This awareness increases the stress in your life in a lot of ways. When your stress finally boils over, it causes psychological trauma. This could mean that people with greater awareness are subject to more psychological trauma than other people. You deal with your trauma as best you can (or not—many people still consider therapy to be a sign of weakness). I believe that If you don’t deal with your trauma, it can lead to an ongoing disorder. A mental or personality disorder can be inherited or developed, and one way to think of them is when you are using coping mechanisms that are counterproductive but are trapped in a cycle through brain chemistry or helplessness. If you don’t get help with your disorder, it can become incapacitating.
And third, gifted people have different social support systems than other people. Your support system is the collection of people and services available to you that you know about and use. Gifted people tend to have fewer people that they feel like they can talk to. Sure, they develop strategies to fit in (i.e., avoid detection, like the closet of gay people). I even applied some of my own in writing this answer. But aside from some of those strategies being unhealthy, the end result is they have fewer people they can talk to, fewer people who they can listen to, and fewer people with helpful advice.
In fact, the asynchronous development of gifted children often starts them off with even more trauma than other kids. There is a lot of stuff out there on this topic, because kids are easier to study than adults (we already keep them in an environment that has a bit too much in common with a prison for me). This isolation that a gifted kid encounters is pretty broadly known and discussed. But that hasn’t changed much for the kid. The typical bit of advice given to a gifted kid during their developmental stages is just “try harder,” and that’s not really good or helpful advice.
So if you are more susceptible to trauma, are more prone to experience trauma, and have fewer external resources to deal with trauma, then that’s a lot working against your mental health. Intelligence can make it easier to manage these things, as it gives you a better understanding of your own reactions to your trauma and the ability to come up with or find strategies that do help. Indeed, research does seem to indicate that the minds of gifted people are particularly resilient in the face of trauma. I think some of that resiliency comes from the extra practice.