But part of this process is candidates being nominated by the major parties, and the RNC put forward a candidate that people actually wanted to elect. The DNC did a worse job of this, as a seeming plurality of votes for Harris were not because they liked her, but because she was "not Trump".
Both parties have agency, but the DNC did a worse job at picking their nominee (assuming the goal was to win an election).
Dem flaws aside, Trump isn't just 'a candidate people actually wanted to elect'. He's an authoritarian, every major prediction about how authoritarian this administration would be has turned out to be correct, he instigated efforts to overturn the result of the last election where he lost, and 25-30% of the voting population likes authoritarianism and do not give a shit about what the Constitution actually says.