"What happened to create so many homeless?"
Really, I'm almost shocked at this question...
I know about California because that's where I live. What is similar or different where you live?
Here in California, we just about had a handle on providing services for the mentally ill people who had been on the streets since Reagan closed the mental hospitals when he was governor of California. I was working in Berkeley in those years, and the city slowly and carefully, supported by NGOs, got people help, one by one, and ultimately almost all of them off the streets. There were just a handful left downtown.
Then, the "new" highly addictive drugs flooded the street market, endangering lots of people but particularly the young adults. Many "rehab" facilities in California recruited in the midwest and bussed "patients" here for their programs (corporate greed and exploitation of a social issue). 30-60 days later, they were pronounced cured and discharged (without bus fare home). Winter in California has better weather than almost anywhere else, and they had nothing to go "home" to, so they stayed here. And of course they had their new friends with them, and they were all highly susceptible to relapse, which they have done in huge numbers, i.e. new street people.
Simultaneously, the high tech industry had finally totally oversaturated the housing market. The housing boom had encouraged municipalities to zone downtowns for high density, while prohibiting the building of single family homes of less than 2200 sq feet. Those changes caused many seniors to leave their homes, and many more assisted living facilities have been built, and are full of those who can afford them.
But the seniors who cannot afford assisted living, and the young people without roots, and families with more kids than they can feed on their retail or fast food income... all of these are competing for a very small amount of housing.
Now add 7 catastrophic fires and 4 floods that destroyed many thousands of homes inside of 2 years, and we have an Extreme Housing Crisis in California- which in turn is exacerbating mental health issues and causing new ones (PTSD from running through fire to escape, for instance), thousands of people are without work because their workplaces burned up, cars were destroyed, all clothing and household belongings gone- and there literally is no place to live to start over.
Bingo! We have just increased the homeless population by many thousands of people. See, it is not a simple situation, there are complex causes, but I think the underlying theme is poorly thought out government decisions, particularly zoning- which has terribly affected available housing. People in their 60-70-80s don't want to live in the 2200+ sq ft house anymore. And neither do young families, because they just can't afford it, financially or time-wise. But the small homes have been torn down, and it's illegal to build more. Makes no sense, at all.