LA county has almost 10M people living in it. SF has only 800K. If housing prices were equal, you'd expect LA to be 10 times the size (assuming an equal number of people per dwelling).
Yes, it's difficult to make a fair comparison across counties of such vastly different areas and populations. LA county includes far-off places like Palmdale which bring the average housing price way down. If you only looked at more central neighborhoods like Hollywood, Beverly Hills, Santa Monica, etc. you'd see distortion more akin to SF.