Those Liberal Republicans and Those Conservative Democrats
At one time whether you were Republican or Democrat was based generally on where you lived. Republicans were northerners and more industrialist and Democrats were southerners and more populist. Not always, but generally. Both parties had conservatives and liberals in them. During the civil rights era of the 1960s the Democrats led the fight for civil rights, especially the Democratic president. When the civil rights legislation passed, it pissed off all the conservatives in the Democratic party and they fled to the Republicans. So the south, which used to be the stronghold of Democrats was lost and became a Republican stronghold.
What I find very funny is that modern Republicans like to talk about how they are the party of Lincoln. Which means they now embrace the liberal principles they fled the Democratic party to escape. In 40 years they will swear that they were the ones at the forefront of promoting gay marriage!