The slightly bigger picture: People become less liberal when they are aware of the existence of other people Not Like Them with whom they're sharing a country, but become more liberal when they actually interact with those people.
(This is conjecture, but it seems awfully plausible and explains both the observations here.)
When another group with (possibly) different norms has no affect on you, it's easy to ignore them.
When that group can exert some effect on you, but the effect is unknown, people get scared, and act accordingly. This is exacerbated by people that like attention and/or power that will stoke these fears to further their own agenda.
When that group is finally encountered, often there's understanding, a willingness to compromise where needed from both parties, and as the unknown subsides, so does much of the fear (and the power that grants those that use fear).
The population density effect works against Democrats too...
"This demonstrates the level of gerrymandering that republicans have accomplished, maximizing the number of districts that are republican, even if just slightly, while shoving all democrats in their states into a few districts that are heavily democratic."
(This is conjecture, but it seems awfully plausible and explains both the observations here.)