I was amazed to learn that during the Civil war it was the democrats who supported slavery and white supremacy and after it - segregation laws, with their followers forming lynch mobs. How did such a radical turnover happened?!
You may be interested in this answer from 5 years ago by /u/Samuel_Gompers on a similar question.