The mercurial early part of Donald Trump's first presidency laid the groundwork for a Democratic rebound two years later.