The US had several political realignments from the Civil War to 2016. Ever notice how some southern Americans hold up the Confederate flag? Democrats were champions of states rights (and typically are more intolerant of racial diversity) back then.
Lincoln, while technically a Republican, is closer to a modern-day Democrat than he is to a modern-day Republican. The Republicans then, in general, are closer to modern-day Democrats. You should google it, it's quite fascinating really.