Between 1900 and 1972, both parties had liberal, moderate, and conservative wings. The bigoted South had repudiated the Republican Party after the Civil War and kept black voters from voting at all. They were far more conservative than anybody in the country today. They were against government assistance, against labor unions and labor generally, virulently isolationist, and everything else. From 1900 to 1928, Republicans won five of seven elections because there weren’t sufficient Democrats in the rest of the country. And they only lost those two because two Republicans (Taft and Roosevelt) split the vote against Wilson in 1912.
The Depression finished Republicans and FDR picked up huge numbers of voters who wanted all the things conservatives hated. Many of his programs, though, got derailed or watered-down by the Southerners in Congress. Truman’s close win in 1948 was a fluke. Eisenhower’s huge wins weren’t.
The parties shifted as of 1972. The liberal wing of the Republicans vanished and the conservative wing of the Democrats started its swift fade. Civil Rights made the South implacable enemies of the Northern Democrats. Nixon’s Southern Strategy welcomed them, effectively telling the South you can be as bigoted as you want as long as you vote for us. The South is now almost as solid red as it used to be solid blue. That means Democrats once again have to pick up votes in a fraction of the country.
They’ve done a good job of that. Since 1972, they’ve lost the popular vote only once, to war hero Bush in 2004. That’s a half century, an absolutely remarkable string, matched only by Republican domination after the Civil War.
If you went by popular vote, only 2000 was truly close. Clinton had 3 million more votes than Trump in 2016. Of course the Electoral College gives a large number of small states the power to overturn huge majorities in a few large states. That’s not due to gerrymandering, BTW. No gerrymandering at the state level. Only Congressional districts get gerrymandered for federal elections.
As stated by others, modern society effectively silos voters into hearing what they want to hear, magnified and propagandized. Once the country entered this condition, it became increasingly harder to break out of it. The randomness of local conditions puts the split as very close to 50/50 in a few states and it happens that these are sufficient to decide an election.
But it’s very possible that the outcomes this year won’t be as razor-thin as pollsters predict.