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

Barack Obama received 2,907,450 (53%) votes beating Mitt Romney, who got 2,619,580 (47%) votes, by 287,870 votes in Pennsylvania.

Mitt Romney won 55 counties whereas Barack Obama won 12 counties in the total of the 67 counties in the State of Pennsylvania.

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 Pennsylvania (with 2,907,450 votes) represents 4.4% of his popular vote victory. The remaining 49 states contributed to the remaining 95.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 (Philadelphia, Allegheny, Montgomery), 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

Philadelphia, Allegheny, Montgomery, three of the larger counties, voted in favor of Barack Obama giving him 611k vote advantage. Mitt Romney's steady win in the less dense counties was not enough to overcome that deficit, making Barack Obama gain an upper hand in the State of Pennsylvania.

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