There are several theories of electoral politics, that elections are determined by macro-events; or campaign mechanics; or ideological ebbs and flows. Some of these theories are determinist; some are contingent. The truth is that, at the presidential level, every election is different and each is governed by some combination of the above.
Some people believe that the candidates themselves matter; that apart from the dialectics of history or the economy or their voting records, that a bad candidate can be repellent and a great candidate can create a bond with voters that transcends pretty much everything else.
If you subscribe to this theory then in 2020, after Marco Rubio has won his second term by a landslide, you’ll laugh at how anyone ever thought Donald Trump might have won the Republican nomination.