In my opinion, this all goes back to the culture war that began with Roe v. Wade. Abortion is what slowly and, then in a landslide, drove former working-class Democrats into the Republican party - first as voters, then as registered voters. The battle over same-sex marriage did not start the landslide, but it solidified the landslide. Now, more recently, with overturning Roe v. Wade at the same time as the left‘s push for transgender education in elementary school, and the base of both sides are now deeply entrenched in these cultural positions. Racism – real and imagined - has always remained simmering below the surface, sometimes near the top, and sometimes near the middle, and gets pulled out as an extra hole card when the votes get close.
The economy will soon push social issues off the front page of voter interest again. Big Labor + inflation will pull in the oars, layoffs will follow quickly, and poof … nobody will care much about drag queens and transgender stuff.