woah, I'm in 100% agreement with Loesberg on this. Savor it!
That said, I do think it is very interesting to think about why things shake out the way they do. The examples in the original question weren't great examples for exactly the reasons the Professor mentions - it's fairly easy to figure out how things managed to align that way from first principles. But there are other examples where there is much less internal logic and it could just as easily have shaken out the other way, and this is where things get very interesting. It's not so much about chance, but about tribalism. You have maybe 2 or 3 really big reasons for picking your team - in rare cases, this is based on ideological reflection, more frequently it's based on tribal identity.
So you migrate to your team on the basis of those 2 or 3 things and then you discover the other 99 things that come bundled with it. Maybe you instinctively agree with your team's Official Position on all 99, more likely you have to give it some thought, and the process of giving it some thought is not a neutral process because you've already chosen your team. So your primate brain tends to decide your team is pretty much right about everything and the other team is pretty much wrong about everything, and your brain would have been just as likely to reach the opposite conclusion on all of those issues if the board had been aligned differently from the get-go. (Clinical example: Max Boot, who decided the GOP was wrong about Trump and then immediately decided the GOP was wrong about absolutely everything.)
But that only accounts for how the cluster perpetuates itself (which is an interesting enough question), not for how it formed in the first place. There are a lot of plausible accounts for this, and sheer random chance is one of them. But the bigger one of them is sheer personality - or, if you want to put a more positive spin on it, leadership. One of the things mentioned above was military interventions. At this point, the Trump wing of the GOP (in other words, the majority of the GOP) is probably more firmly against foreign military interventions than the Democrats (how's Tulsi Gabbard doing in the polls?). The opposite was true 10 years ago when the most prominent GOP leader was Dubya. This is not because the GOP rank-and-file was persuaded by the sheer logical force of Trump's arguments about how the Iraq war was a disaster. It's because Trump is charismatic, said the magic words that activated the "5th Avenue Rule" with respect to the 2 or 3 things on which people base their tribal identity, and then everything else he said came along with the bundle. It is *that* easy to change the opinions of tens of millions of people on an issue you would expect to be of exceptional importance.
Note that this is basically a constant of human psychology and not a phenomenon unique to any party or clique.