ThisThis article from fivethirtyeight analyses California's shift from Republican to Democratic in depth. Some interesting passages:
Southern California was Republican-leaning, largely because the defense industry was a major economic engine [...] In the early 1990s, defense spending began to fall, and numerous military bases in California were closed. This helped spark an out-migration of mostly white, affluent and Republican-leaning residents, including many former defense-industry workers.
[...] The influx into California of Hispanics and Asians had an even larger effect. Between 1980 and 2000, California’s Hispanic and Asian communities each doubled as a share of the state’s population.
[...]Its main economic drivers were changing. Although agriculture remains a major industry, defense faded and Hollywood and Silicon Valley grew. California saw an influx of highly educated young professionals.