How are the presidential primaries different from the actual US presidential elections? Does the presidential election depend on the outcome of the presidential primaries? And who are the delegates in the primaries?
The US presidential primaries are when the two major party candidates for president are chosen. Other candidates can run in the general election, but the two nominees will be the only Democrat and Republican candidates respectively. It is possible for a different candidate to win the general election, but that hasn't happened since 1860. There were notable third party attempts in 1912 and 1992, but they ultimately failed.
Technically, the two party nominees are chosen in conventions in the summer by delegates elected in each state. As a practical matter, the conventions are usually formalities with the actual nominees being determined far earlier. It is possible that this year, the Republican nomination might go to the convention, since the field isn't narrowing as expected. At the convention, they could either pick an existing candidate or nominate someone new.
This is also complicated in that some states (e.g. Iowa and Nevada) elect delegates to county conventions who elect delegates to statewide conventions who elect the delegates to the national convention. No primary elects delegates this way, but caucuses can.
Overall, the eventual winner does not have to compete in the primaries, but there are no recent examples of a winner who was not. Starting with 1860, every election has been won by either the Democrat nominee or the Republican nominee. And there hasn't been a brokered convention since 1952 (Democrat Adlai Stevenson who lost to Eisenhower). Every nomination since then has gone to the leader from the primaries.