American presidential elections follow a fixed timetable in a system that has its origins in the American Constitution.
Party primaries or in some cases caucuses begin in the January of the election year. Both major parties (Democrat and Republican) go through this process, unless their candidate is uncontested (as is usually the case with a sitting president).
Why are their party conventions?
From the primary/caucus each state party nominates delegates to their respective party conventions in July. It is at the conventions that the presidential candidates are formally nominated.To become the nominated candidate you need to achieve a majority at the convention. Where no majority is possible there can be a 'brokered convention' where the part proposes a compromise candidate.
What is the difference between a primary & a caucus?
Participating in the Iowa Caucus famously requires a high level of commitment. Iowans need to travel to public meetings in school gyms, arts centres, churches, libraries, restaurants and even fire stations in 1,681 precincts to vote for a candidate. Voting can take several hours -- and involves 'retail politics'. The respective campaigns directly interact with voters before they cast their ballots.
For the Democrats there is no secret ballot - voting is on the 'show of hands' principle