The standard Democrat rejoinder is that ‘Those Democrats became Republicans as part of Nixon’s “Southern Strategy.”’
It may not be true but that doesn’t bother them a bit.
I always wonder "when did that happen?"
I have the answer to that one anyway. The parties switched places because the Democrats went from pro-slavery to anti-every-boundary-in-civilization. The Republicans stayed approximately in the same place.
In that sense, the Democrats went from being far to the right of us (if "right" means "for civilization as it was thousands of years ago, when slavery was the norm all over the world") to being far to the left of us (which means "against everything that makes civilization work").
The Republicans stayed the same. That's the "parties switching place."