Jokes aside it was a shift starting with the 1960s civil rights movement. Lindon B. Johnson signed the Civil Rights Act into law as well as Food Stamps and various welfare policies, which while a big departure from the then Democrat platform did have a very big impact on the image of the party and over the years led to more progressives running as Democrats and voting for Democrats, while another demographic never voting for them ever again.
The image below depicts partisan splits in congress dotting how likely each rep was to vote with the other party.

Image Source: Andris, Lee, Hamilton, Martino, Gunning, and Selden, "The Rise of Partisanship and Super-Cooperators in the U.S. House of Representatives."