SF conducts a sort of census of their homeless population. One of the questions asked is where the person lived when they became homeless. The majority are from SF:
> Sixty-nine percent (69%) of respondents reported they were living in San Francisco at the time they most recently became homeless. Of those, over half (55%) had lived in San Francisco for 10 or more years.
The idea that SF "collects" homeless people (from elsewhere) is a myth not supported by data.
It is, actually, supported by the data you just posted to refute it, which indicates nearly a third of SF homeless were not in SF when they became homeless.
What are the numbers like for other cities?
Those numbers aren't collected in a national and standardized way. Even if other cities collected data about this question, please don't compare the numbers without also comparing survey methodology.
SF and LA have higher absolute numbers of homeless because both cities tolerate it.