I agree that mental health issues are a serious driver for homelessness. We see that 20-25% of the homeless population has serious mental health issues... not all of them, but much higher than the regular population.
However, this doesn't explain why some cities have way more homelessness than others. It's not like there's way more insane people in Portland than other cities. Take a look at the third chart on this page- https://www.sightline.org/2022/03/16/homelessness-is-a-housi...