Party realignment in the United States

A party realignment in the United States is when the country transitions from being mostly run by one political party to mostly run by another political party.  During party realignments, some groups of people who used to vote for one party vote for the other one.  Sometimes, political parties end and new ones begin.  Party realignments can happen because of important events in history or because of changes in the kinds of people in the country.

1820s
In the early 1800s, America had the "First Party System" with the Federalist Party and the Democratic-Republican Party. When James Monroe was elected President of the United States, the Federalists died out. There was an "Era of Good Feelings" of one-party rule by the Democratic-Republicans. In the United States presidential election, 1824, four different men ran for President, all as Democratic-Republicans. John Quincy Adams was elected.  

After the election, Andrew Jackson formed a new party called the Democrats. Jackson's party was strongest in the South and West, and in some cities (at this time, only a few Americans lived in cities). Soon after Jackson's election, another party formed around supporters of Adams and Henry Clay. It was first called the National Republican Party, and later the Whig Party. The Whigs were strong in the North, and among the middle class and businessmen. The system of Democrats and Whigs is called the "Second Party System."

1850s-60s 
After the Kansas-Nebraska Act, the "Second Party System" ended: 

 Whigs and Democrats who did not want to pass the Kansas-Nebraska Act (which would use popular sovereignty), and Free-Soilers (who, as a rule, opposed the expansion of slavery) formed a new party called the Republicans. The Republicans' main goal was stopping slavery, but they also liked many of the things the Whigs liked.
 The Whig Party broke up.  Some Whigs joined the Know-Nothing Party or other small parties for the 1856 election. More joined the Republicans or Democrats.
 In the 1860 election, Know-Nothings and Southern Democrats who supported the Union formed the Constitutional Union Party.  During and after the American Civil War, the Know-Nothings and Unionists were part of the Republican Party.
 In 1860, what was left of the Democratic Party broke into Northern and Southern wings, one on each side of the Civil War.
 By 1868, the Democratic Party came back together and there was the "Third Party System" of Democrats and Republicans.

1930s
America went from being mostly Republican in the 1920s to mostly Democratic in the 1930s.  This was due to America becoming much more urban, and the Great Depression.  Franklin D. Roosevelt formed a coalition that would mostly last until 1964 called the "New Deal coalition." 

Urban areas became very Democratic.  They voted very heavily for people like Al Smith and Roosevelt.  They had been growing rapidly, due in part to immigrants who were part of democratic political machines.
African American citizens had been moving from the South into large Northern cities, in large part due to racial segregation.  Before the 1930s, they had either not voted or voted Republican.  Under Roosevelt, they mostly voted Democratic
Roosevelt also made gains in every part of the country, due to his mass appeal and the desire to end the depression

1960s-80s
In the 1960s and 70s, the New Deal coalition fell apart.  This was due to the  Civil Rights Movement, Roe v. Wade, Vietnam War and the suburbanization of America.  What changed:

After the 1964 Civil Rights Act, many white, conservative Southern Democrats became Republicans.  The South had been mostly Democratic before 1964; it was mostly Republican after (Although on the local level continued to be heavily democratic for decades).
Many "values voters" became Republicans.  These were people who voted based on their own form of morality. To them, abortion and gay rights were immoral. In the 1960s, sex was closely tied to morality.  In this way, people who opposed abortion and gay rights, for example Jerry Falwell, and the changes to society happening in the 1960s and 70s, became Republicans.
Republicans also made some gains among working-class Catholics, who are mostly conservative on social issues. 
The Democrats were able to make gains among more liberal Republicans and with Latino voters.
Working-class Democrats voted for Republicans in the 1980 election. They were called Reagan Democrats because they voted for Ronald Reagan.

History of the United States
Politics