The Chinese food in San Francisco's Chinatown is poor. The Chinese food in Los Angeles' Chinatown is also quite lousy. Yelp isn't necessarily the most accurate of judges, but good luck finding any Chinese restaurant in either Chinatown that can sniff an average review much north of 3 out of 5 stars.
The best Chinese food in both cities is outside the downtown areas. In the Bay Area, you can find much better Chinese food in Millbrae, Daly City, Cupertino, Santa Clara. In Los Angeles, the best Chinese food is East of Los Angeles, in places like San Gabriel, Monterey Park, Rosemead, and Alhambra.
Having lived in those two cities most recently, I grew accustomed to having to drive a half hour or more from where I lived to seek out decent Chinese food. I knew many others who did the same.
If great restaurants were located based on demand, you'd expect San Francisco to have really great Chinese food because the Chinese population in San Francisco is huge, and like most other Bay Area populations, they love to eat.
My theory is that the number of great restaurants in an area is a supply side problem. That is, great restaurants end up where the great chefs want to live, and where the best chefs want to live is not in Chinatown in San Francisco or Los Angeles.
First of all, the cost of living in San Francisco proper is exorbitant and getting worse (the Twitter IPO should help, no?). Secondly, the Chinatown area isn't really that desirable an area to live in the minds of many immigrants from Hong Kong, source of many of the world's great Chinese chefs. In the suburbs those immigrants can buy much more space for the money.
Furthermore, the demand for great food is so high that you don't necessarily have to locate somewhere with the population density of a major metropolitan area to sell out every night. A Japanese restaurant like Wakuriya in San Mateo here in the Bay Area is really difficult to get a reservation for. El Bulli was not in a major city, one had to trek out to Roses in Catalonia in Spain. As long as they can get access to the right great ingredients, whether locally or by delivery, great restaurants can locate just about anywhere and sell out.