Take mental illness. A mentally ill person with more resources can get the care they need, but someone who is poor can soon find themselves on the street. And homelessness itself is quite stressful, and can produce or exacerbate mental illness as well as drive people to drug addiction.
Homeless people are just like the rest of us, with their own basic human needs, and just like everybody else are trying to navigate their world as best they can.