To be fair this is mostly a recent phenomenon, for most of American history one party dominated for a few decades and then the other party dominated for a few decades. Now we have very close elections every time which is why this is the Era of Divided Government.And the history of US elections is Americans always vote for the person they’ll eventually regret. That’s why it goes back and forth.
Also even if a President is very popular he can only win twice and the replacement is unlikely to be as popular. Bill Clinton in 2000 for example probably would have won given that he was a better politician than Al Gore and the election came down to like 100 votes. Similarly Obama probably would have had a better shot than Clinton in 2016 and whoever the Republican candidate is will probably be weaker than Trump as Trump seems to have a unique vote getting ability that doesn't really transfer to other Republicans which is why the Republicans seem to lose whenever Trump isn't personally on the ballot.