See, historically, when we spoke about parties, we really spoke about their respective establishments. The voters decided which one would be running the show at any given moment, but internal party politics were not readily accessible to the outsiders, and thus candidates and platforms were also vetted by the party establishment. Since establishment tends to be conservative by its very nature, this provided a screen against more extreme positions. To be clear: the politicians would still run on extreme positions, if they saw it as advantageous - but that didn't mean they'd govern accordingly if they won.
Then we got primaries. It's not that they didn't exist before - the first ones date back to before the Civil War. But they weren't anywhere near as common until the second half of the 20th century, and even then most were non-binding (and their results were often ignored when the "wrong" candidate won them).
And the primaries themselves changed over time, generally so as to broaden eligibility. In most other countries (where primaries are internal party matters), you have to actually be a member of the party in good standing in order to participate in that party's primary. The American system, where you merely need to register party affiliation in advance, is much more lax - and by now, even that formality is no longer necessary in many states.
So, voters now have a lot more influence over party politics. And this caused a nasty feedback loop, where agitprop that's thrown by the establishment at the voters, solely for the purpose of convincing them to vote one way or the other (appealing to emotions, especially fear and anger, since it's the most effective way), is regurgitated and injected into internal party matters and policies. So the party platform moves further away from the center, and its agitprop shifts accordingly, creating even more radicalized supporters, who again feed it back into the party etc.
Tea Party was a wake-up call in that sense, when a bunch of traditional Republican candidates lost to grassroots crazies who said mostly the same things, but who also sincerely believed in those things. Trump is also part of the same phenomenon - he might not be a sincere believer, but he appears as one to his followers. And there's some evidence of similar processes happening in the Democratic party. Slower, because its electorate is a broader coalition with more conflicting goals, and so the direction in which the voters move the party is less clearly defined. But you can see the internal radicalization spill out on some issues already, and there's more to come.