I once took a University course that dealt with this exact topic.
When there are only two primary parties in a democratic system, their platforms tend to be almost identical, even if they brand themselves as completely different (and the media loves to run with that branding hype, because they tend to be greedy and they literally make billions of dollars off of it).
The reason that, in a democratic system, the platforms are almost identical is because they both want to win a majority of votes cast. To do this, they both get as close to the center of the political spectrum as possible, with one very slightly leaning to the left, and the other to the right. By doing this, they hope to capture all the votes from their position within the left-right scale all the way to the far left or far right.
If one party deviates from the center, the opposing party will then capture, in theory, approximately half of the votes that are created in the gap that forms.
What you see in the media is a lot of blustering and hype, often to satisfy a personal agenda of specific politicians, often because they want to profit financially or to gain a little (or a lot) more power. In reality, the actions of the Democrat and Republican politicians, collectively, are quite similar.
The exception to this is caused by the fact that the USA does not (currently) actually have a democratic system of government. The USA is currently a democratic republic in which voters in certain states have much more power than those in other states. In other words, the vote of someone in a populous state, let's say New York or California, counts significantly less than the vote of someone in a much less populated state, let's say Wyoming or Alabama. This is due to the popular vote in the USA being essentially meaningless, and instead, an electoral college is still used to actually determine who wins a presidential election. This imbalance was created as a concession to states with slaves that didn't want to end slavery. For more details, you can read this article on the electoral college.
Because of the electoral college, sometimes one of the political parties will veer out to an extreme (historically to the far right, because the electoral college favors states that historically did not want to end slavery) during a presidential election cycle. This is because they aren't primarily concerned about capturing the popular vote; their primary agenda is to gain power by capturing the electoral college.