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

Barack Obama received 1,527,690 (63%) votes, beating Mitt Romney who gained 904,970 (37%) by 622,720 votes in Maryland.

Mitt Romney won 18 counties whereas Barack Obama won 6 counties in the total of the 24 counties in the State of Maryland.

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 in the State of Maryland (with 1,527,690 votes) represents 2.4% of his popular vote victory. The remaining 49 states contributed to the remaining 97.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 (Montgomery, Prince George's, Baltimore, Anne Arundel, Baltimore City), 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

Montgomery, Prince George's, Baltimore, and Baltimore City, four of the larger counties, voted in favor of Barack Obama giving him a 694k vote advantage. Anne Arundel, another larger county voted in favor of Mitt Romney giving him a 2k voter advantage in that county. However, Romney's steady win in the less dense counties was not enough to overcome that deficit, making Obama gain an upper hand in the State of Maryland.

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