A delegate someone who is either chosen or elected to vote or act for others. In organizations like the United Nations, each country sends delegates to represent them.
Before a general election in the US, the process to select candidates begins with delegates. At the state level each of the major political parties selects delegates to attend a national convention. The two ways delegates are selected are the caucus and the Primary election. Each state may have different ways to select delegates as do political parties. The Republican Party lets each state decide how to select delegates. The Democratic Party uses a proportional method for awarding delegates. The percentage of delegates each candidate is awarded depends on the caucus or how many are elected for each candidate. Candidate "X" may have 40 percent, candidate "Y" may have 20 percent while candidate "Z" may have 50 percent. Any remaining percent may be undecided votes or for other candidates.
A candidate becomes his or her party's presidential nominee after the delegates sent to the convention give that person a majority of the votes. Because there are often multiple rounds of votes taken to select a presidential candidate, delegates sometimes change their votes. But in recent elections that has become unnecessary. Since 1976, it was fairly clear who was the front-runner even before the first vote was taken.