The reason Tesla is in Fremont is not for proximity to Silicon Valley, which has not benefited Tesla in any way. They are in Fremont because they could move into an already-built Toyota assembly plant and hire abundant local autoworkers.
After 30 years of increasing imports when government subsidies ended so did local manufacturing. Most cars sold in the country are now built in Thailand, South Africa, Japan, Europe and increasingly the USA - without any kind of huge price jump over locally produced vehicles.
We even had factories here, but they were too expensive to run. It's cheaper to ship them from overseas.