Maybe the third time is a charm, but the second isn't. As every schoolchild knows, Stephen Grover Cleveland was elected president, lost reelection, but then came back to win the next time. But he was the only one to do that. So how common is it for an election loser to win a rematch? We don't have a lot of data from recent presidential elections (because there aren't a lot of presidential elections every year), but there is quite a bit of data from Senate and gubernatorial elections. It is not encouraging for Donald Trump. In 25 Senate rematches since 1950, the loser lost again 23 times. For gubernatorial races, it was somewhat better for the loser: In 30 out of 44 rematches, the loser the first time lost again the second time. That's a total of 16 rematch wins in 69 tries, or a 23% success rate.
In 2022, there were two gubernatorial rematches. In Connecticut, Gov. Ned Lamont (D-CT) faced Bob Stefanowski (R) again. In Georgia, Gov. Brian Kemp (R-GA) faced Stacey Abrams (D) again. Both elections went the same way the second time as the first time. On the other hand, in 1980, then-governor of Arkansas Bill Clinton lost to Republican Frank White. But 2 years later, Clinton defeated then-incumbent White. So it does happen.
One reason for it being tough to win a rematch is that by definition, the challenger is running against an incumbent, and being an incumbent is valuable. You are better known and can use the powers of the office to do things the voters like. Of course, every election is different. Biden has an extremely low approval rating and Trump might be a convicted felon by Election Day next year.
If you want to go back to the beginning of the Republic, there are more data as follows:
But the only one of these in which a sitting president faced a former president was 1892, when Cleveland got his old job back. (V)