Complaints that our electoral process is undemocratic abound. Donald Trump wants a simple majority of the Republican Convention delegates to determine the nominee. Bernie Sanders supporters bemoan any primary--like New York's--limited only to long-registered party members. Super delegates, assigned by the "party establishment," act as they see fit, representing the party's needs over the views of voters. The phrase "party establishment" gets tossed around like a curse. The system, especially at the primary level, has been widely declared to be "broken."
The discussion currently focuses on the primary process, since we are in the midst of that contest. The primaries were added to the electoral process in the nineteenth century, when parties became an accepted part of American politics. In the primaries, party voters, acting state by state, choose delegates to attend a convention that will in turn choose a party candidate. None of this was set up at the founding of the United States; all of it was the invention of the parties themselves. States choose according to their own specific rules--whether caucusing or voting, whether allowing non-party members to participate or not. In the end, some delegates are pledged to a candidate, although they can shift their support over the course of a convention; other delegates enter the arena free to choose. The process is anything but democratic. Since parties came to have a lock on our choice of Presidential candidates, the interests of the party--to choose electable candidates who will further its specific party goals but also maintain its power (sometimes sacrificing ideological purity to do so)--are paramount. Those interests are patently not to simply reflect the will of the people, but are instead about harnessing that will to party ends.
Lest you conclude that parties have hijacked the political process, making it less democratic, remember: the founders who advocated for the U.S. Constitution feared democracy. They were not advocates for majority rule, but its opponents. In the immediate aftermath of the American Revolution, when the U.S. government was only a loosely-united collection of states, state politics trumped central decision making. The Articles of Confederation gave the central government no coercive power. If states wanted to send money (say, to support the Continental War effort) they did; if not, they did not. Some men, perceiving a need to address the lack of power at the center, felt motivated to alter the basis of government, giving more power to the new federal government and concomitantly less to states. Most who opposed the Constitution did so because they saw it as anti-democratic. Constitution advocates thought the initial system had been too democratic and diffused, and they wanted the emerging national elite to wield more power. So democracy, far from being the goal of the Constitution, was seen as an excess to be curbed. A suspicion of democracy was utterly consistent with the political theory of their day, which posited that excess in any direction lead to dysfunctional government.
If party elites follow the lead of the founders in suppressing democracy, it is also the case that the founders would not have loved this solution to the problem of excess democracy. They utterly opposed political parties. Deriding the idea of party with the word "faction," they asserted that those who entered into party configurations acted for their own self-interest rather than for the common good. When they created the new federal government, they hoped parties would never arise. Their hopes were quickly foiled, as the election of 1800 (just a dozen years after the adoption of the Constitution) witnessed the first party configurations. Parties went in and out of existence, shifting and changing names, from that time until the era of the Civil War.
Since the end of that conflict, the two parties we have now, Republican and Democratic, have been in existence. Whatever their particular ideological stripes of the moment, the parties exist to block competitors (hence the deck is stacked against Independents), and to maintain the power and influence of parties. The primary system, while it accords with the founders anti-democratic impulses, is the creation of the parties. The parties the founders denigrated now defend the anti-democratic impulses those same men endorsed.