There is a discussion in the MSM to the effect that the South becoming all-Republican after being all-Democrat thru the Jim Crow years is based on racism. What I know to be true is today's GOP holds many of the values that an earlier era's Southern Democrats held.
I grew up among Southern Democrat adults who believed in a strong military, and served in the World Wars. They looked down on people taking welfare, were very clear about the differences between right and wrong, and shunned "trashy" people of any race. They honored FDR for grappling with the Depression, unlike Hoover, and for leading during WW II.
In general, southerners left the Democratic Party when the party no longer would tolerate conservative members. Those of my older relatives who lived into the early 1980s all became Reagan Democrats first and then Republicans. I'm certain they agreed with sentiments expressed by Ronald Reagan, who famously said, "I didn't leave the Democratic Party, the Democratic Party left me."
That process continues today, not only in the South. Democrats are in danger of becoming exclusively the refuge of "victim" or "outsider" groups, people aggrieved at the way life has treated them and those like them. As long as this great nation continues to deliver a reasonable chance at an okay life to most of its citizens, the "victims" will fall short of a national majority.