Democrat party "lessons learned"
Consider in 2012 the republicans did a postmortem of Romney's loss and decided they needed to be more welcoming of minorities and hispanics in particular. Instead they ended up doubling down on their anti-minority policy by nominating Trump. Of course that wasn't the party's decision but the voters, and it ended up working out for them despite that, but it just goes to show that what a party decides and what the individuals who vote in its primaries decide may not agree.
If the democrats learn the lessons they should, the number one lesson they would learn is that the DNC shouldn't favor one candidate over another. Sanders probably beats Trump because he did not have all of Hillary's baggage that made her an easy target, he spoke to the same working class anger Trump did, and he inspired young people. But against ANY other republican a democrat who used to be a socialist may lose due to that alone - so the party might have thought they were saving themselves from a Mondale like landslide loss.
Another thing that parties never seem to learn is that the candidate with the most charisma almost always wins. Trump may not have much charisma, but compared to Hillary he's a fucking star. You don't need charisma to beat someone who is as stiff as Hillary - look at Bush I beating Dukakis, the ultimate stiff. And Bush II beating Gore and Kerry, two more stiffs, though Bush II had some good ol boy charm that played well down south.
Unless they nominate another stiff in 2020, the democrats should win the election easily. Trump's massive negatives aren't going to go away, if anything they will only get worse with four years of daily exposure. To the extent he isn't able to keep his promises to the blue collar workers who got him elected their enthusiasm for him will dim, as will that of some conservatives who may find he doesn't govern as conservatively as they would like. Meanwhile democrats will come out in force to dump Trump, and can run on a "change" platform that was obviously not possible after eight years in the White House, and if they choose the right person as an "outsider" that Hillary could not.
I think there's a decent chance the democrats could win in a landslide with 400+ electoral votes if they choose someone who is more like Obama or Bill Clinton in the charisma category, and not some establishment stiff. But the fact they haven't cleaned house in the DNC yet tells me it will have to be the primary voters who force it on them. The party machine may try to interfere again, thinking they know what's better than their own voters.
Neither party gets that general election voters don't care about your policies - they want to hear that the economy will do well so they get raises if they have a job, or they'll get a job if they don't have one, and their bills won't go up too much. Most of them could care less about how you plan to deal with China, or Israel or Afghanistan if they economy is working for them. Sure there are single issue voters who will choose based on abortion or global warming or taxes but the parties are pretty set on those issues so those voters have only one choice anyway so there's no point trying to cater to them.