But not completely. The role of Democratic superdelegates was created after the 1980 election to ensure that rank-and-file voters could not easily vote in an activist candidate. Superdelegates include major Democratic elected officials like governors and members of Congress; national and state party leaders; and notable party figures like former presidents Jimmy Carter and Bill Clinton. Democrats have added more superdelegates over the years, and this year they will make up 16 percent of all delegates.

Each of their votes has equal weight to delegates awarded through primaries and caucuses. In New Hampshire, for example, the site of Mr. Sanders’s first big victory, he won about 150,000 votes and 15 traditional delegates. Hillary Clinton won nine traditional delegates. But because six of New Hampshire’s superdelegates are supporting her (the other two are uncommitted), she is effectively tied with Mr. Sanders in the state.

Republicans have far fewer superdelegates. But the way the party conducts elections — a complex, layered system of contests that selects local delegates who in turn select state delegates who then vote for national delegates — can be difficult for newcomers without sophisticated operations to penetrate, as Mr. Trump is discovering.

“It’s hard to start explaining now,” said Curly Haugland, the Republican national committeeman in North Dakota who has tried to draw attention this year to the important role that delegates play. Mr. Haugland summed up the collective realization of many voters this way: “These primaries weren’t really worth much — except maybe to spend a billion dollars.”

Even if Mr. Trump wins a state, the delegates who are supposed to vote for him at the national convention might privately support one of his opponents, and if no candidate clinches the nomination after the convention’s first ballot, these delegates are usually freed from the requirement that they represent the preference of the voters back home. The campaign of Senator Ted Cruz of Texas has been working in many states to get his supporters named as delegates, even if they must vote for Mr. Trump on the first ballot.