Three is a party is spot on. The primary system makes it near impossible for a centrist Republican and difficult for a centrist Democrat to achieve their party's nomination. That said the prevailing wisdom for a long time was that having a moderate candidate was better than not with the example of Barry Goldwater (true conservative Republican) and George McGovern (true Liberal Democratic) who both lost in landslides (Goldwater to Johnson in '64 and McGovern to Nixon in '72).
Nixon was a centrist and Carter was considered a moderate Democrat and even Reagan although more conservative than Nixon was not considered to the far right of the Republican party in 1980. Likewise Bush I was a centrist as was Clinton and later Bush II. Bush II was smart however b/c he courted the evangelical vote and was able to beat McCain in the primary who was more qualified and had better name recognition but Karl Rove framed him as being too moderate especially on conservative values / social issues. Mondale and Dukakis were considered more on the liberal spectrum and both got trounced in the 1984 and 1988 elections which was a big reason Clinton won the 1992 Democratic primary over Jesse Jackson and Paul Tsongas who were much further to the left.
Obama started out to the left of Clinton in the Primaries but was definitely governed more as a centrist than the current progressive wing of the Democratic party led by AOC would have preferred and Trump is hard to pigeon hole as he used to be a democrat, has generally held centrist views but after getting elected went all to cater to the right in nominating conservative supreme court justices and lowering taxes, deregulation, limiting environmental laws, etc.
The parties also seem to be shifting further away from the center. Barry Goldwater was long viewed as a conservative's conservative far more right than the mainstream republican party of the 1960s to 90s but was pro environmental regulation and civil rights. Reagan's tax policy where he said a bus driver shouldn't pay the same in taxes as a millionaire or who believed in worker amnesty programs for illegal immigrants would be scoffed at by today's Republicans in Congress and the state house. Moderate Republicans such as Bill Weld who were fiscally conservative but a bit more liberal on social issues such as abortion or immigration have been run out of the party. Likewise the old Blue Dog democrats have largely left the party and those who used to be considered uber liberal like Ted Kennedy would definitely be viewed as moderates today compared to members of the squad.
Had the incumbent President in 2020 been anyone other than Trump and or had COVID not occurred, it would have been likely that Bernie Sanders would have won the Democratic nomination, it was only the fear that he would not be elected that helped Biden gain momentum in the second half of the primary season. This is similar to what propelled Clinton to Victory in 1992 after Democrats had only won one of the previous six presidential elections and and feared they would lose 1992 with liberal candidate.