A quick google shows that at minimum 25% to 30% of homeless have serious mental illness, and almost half have some mental illness (50%-60% of homeless females suffer from mental illness). There is overlap with drug addiction, but drug addiction tends to represent around 40%-50% of homeless. It's also necessary to differentiate temporary homelessness and long-term homelessness. I didn't find any numbers, but I suspect long-term homelessness is dominated by mental illness and drug addiction. That's not to say people cannot fall on hard times and end up homeless, but that population tends to bounce back within weeks or months and also requires different policy solutions as well.
On a side note, have you walked through homeless encampments in cities like San Fran, or Seattle? It is obvious that mental illness and drug addiction is rampant.
However way you slice it, mental illness represents a huge part of the homeless population. Policy wise, they are treated no different than people who end up homeless due to economic circumstances.