Not entirely by coincidence. Yes Shockley was from CA, but as late as the 1980, two places were competing to be the center: Boston's Route 128 ("America's Technology Highway") or Silicon Valley.

Silicon Valley won out because the CA constitution explicitly prohibits non-competes (which MA allows), leading to more rapid innovation. Very likely the infamous Traitorous Eight who left Shockley Semiconductor to found Fairchild could not have done that if noncompetes could be enforced.

Non-competes are one aspect, absolutely. However that's can't be the whole story because that applies to all of California and it's a decently sized state, with a lot of other areas. Any part of the southern California basin, San Diego, and Sacramento. If we include smaller areas (because silicon valley was once just apple orchards, that list gets longer.