Then there was a variable.
Either he improved or his opponents got worse.
If you mean Reagan, that wasn’t the situation, Reagan ran against two sitting republican presidents, and he almost knocked off a sitting president as the counting went on after midnight “Ford prevailed with 1,187 delegates to Reagan’s 1,070”.
It was during Reagan’s third run that Romney left the GOP, eventually to become a democrat supporter, fund raiser, and even voter.