It's probably not an either or thing.
You probably have some people who get mental illness from joining gangs and you probably get people that had existing mental illnesses going in, and then more likely imo you may have a combination of both.
I don't know which is more prevalent compared to the other.