A head to head comparison of the California 2012 General Election gives us an idea of the break down of the voters.    

Barack Obama received 6,493,920 (61%) votes, beating Mitt Romney who gained 4,202,130 (39%) by 2,291,790 votes in California.

Mitt Romney won 29 counties whereas Barack Obama also won 29 counties in the total of the 58 counties in the State of California.

Presidential General Elections

During the 2012 General elections, over 122M total number of votes were cast. Barack Obama got 62,614,654 (62.6 Million) over Mitt Romney's 59,141,654 (59.1 Million). He won the popular vote by 3,472,979 (3.4 Million). His victory at the State of California (with 6,493,920 votes) represents 9.4% of his popular vote victory. The remaining 49 states contributed to the remaining 90.6% popular votes victory.

Top 15 Counties in Primary Elections vs General Elections

All Candidates (General Elections)

These 15 counties play an important role in these Primary elections. If a candidate, can get a sizable majority in the larger counties (Los Angeles, Orange, San Diego), it becomes very difficult to win majorities in the smaller counties without voter outreach and increased voter participation in them.

Top 15 Counties Comparison in Primary Elections vs General Elections

General Elections
Barack Obama

General Elections
Mitt Romney

Los Angeles and San Diego, two of the larger counties, voted in favor of Obama giving him a 1 million vote advantage. Orange, another larger county voted in favor of Romney giving him a 84k voter advantage in that county. However, Romney's steady win in the less dense counties wasn't enough to catch up, making Obama gain an upper hand in the State of California.

Related References: 2016 California Primary Election Story, 2016 California General Election Story, 2020 California Primary Election Story, 2020 California General Election Story