For the past two years, a question has hovered over American politics. How could the same country that elected an eloquent, well-principled black Democratic president for two terms swing so dramatically to put Republican flame thrower Donald Trump in office?

On Tuesday, the voters who elected Barack Obama woke up from their 24-month nightmare. At polling places across the country, they regained their equilibrium, and showed that the country that originally put Mr Obama in office was still there.

Sorry, this video has expired Donald Trump clashes with reporters in a fiery press conference.

Democrats took back control of the US House from Mr Trump's Republican Party, all but assuring that the President's business dealings will be exposed when the new Congress takes effect in January.

To do so, voters needed a push from Mr Obama himself. His visibility and willingness to wade into the election fray was a historic departure from the role played by other ex-presidents.

In the past, former chief executives might make an appearance or two with a favourite candidate, but generally stayed out of the limelight, leaving the duties of campaigning to party leaders.

Not Mr Obama this time, and the results were clear. The election of women of all backgrounds, and the repudiation of Mr Trump's nasty politics, showed that the seeds of what elected Mr Obama in the first place were still in American soil.

Obama fights back

You can draw a gardening analogy in what has happened in the United States.

How does your garden grow now, Mr President? ( Facebook: Barack Obama )

Often, American gardeners will be distracted by spectacular flowering weeds, like purple salvia, or an aromatic herb such as mint that will show up in their carefully tended beds.

Given summer sunshine and copious rain, these visiting plants can spread across the borders and look temporarily impressive, just as Mr Trump provided unexpected flair on the political scene during the 2016 campaign.

But his rhetoric has proven to be like those weeds, which have to be eradicated lest they put down deep roots and choke off healthy plants, the kind that gardeners hope will keep going for years on end.

In this election, Mr Obama served as the weed killer to start to expel Mr Trump, before his divisiveness became too permanent on the American scene.

His methods included endorsements of more than 340 Democratic candidates, running for offices ranging from state legislature seats to governor's chairs, from the House of Representatives to the Senate.

Mr Obama's first wave of 81 endorsements came in August, although he avoided picking candidates for races where Democrats were running for their parties' nominations. His second round of endorsements came in October, when he gave his backing to 260 more candidates.

Trump overshadowed by Obama rallies

Loading

Mr Obama did more than that, however. He held a series of rallies in places such as Georgia, Florida, Indiana and his home state of Illinois, with tickets in hot demand for his appearances.

The rallies gave the country an opportunity to see what might have occurred if Mr Trump ran directly against Mr Obama, rather than battling against Hillary Clinton, whom he narrowly defeated in 2016.

(Interestingly, she played very little part in this election, making few appearances with Democratic hopefuls, perhaps saving her fire for her paid speaking tour with her husband, former democratic president Bill Clinton.)

The idea of his predecessor out on the road at the same time did not sit well with Mr Trump, who found himself at times overshadowed by the former president. He mocked Mr Obama for the size of his rallies, never mind the fact that Trump rallies often include paid participants.

"I watched him speak today," he said last week. "He had a very small crowd, they don't talk about that. And they never talk about how big our crowds are."

And at one point, Mr Trump, who long questioned Mr Obama's American birth, before finally acknowledging that he was born in Hawaii, emphasised Mr Obama's middle initial — H, standing for Hussein — insinuating that he was foreign born.

Obama sells inclusiveness, respect and thrift

What might have happened had Mr Obama been able to run against Mr Trump nobody knows. ( AP: Pablo Martinez Monsivais )

Mr Obama, for his part, seemed to find Mr Trump both amusing and a threat to the civility that many Americans prize. Rather than go toe-to-toe with Mr Trump, he stressed the characteristics that his supporters often embraced.

Loading

Ideas such as inclusiveness, respectful debate and a careful use of public funds to benefit the country, rather than line politicians' pockets.

Of course, Mr Trump is still President, and will be for two more years, barring the outcome of Congressional investigations that now seem likely, given that Democrats will be back in control of the House.

But his power will not go unchecked now, as it might have been had his Republicans kept control of both Houses of Congress.

The American public, rallied by Mr Obama, now knows how valuable the ballot box can be.

Just as Mr Trump turned a tide in 2016, now the pendulum has begun to swing away from his extremism.

'Our work goes on'

The contrast between the two men became oh so clear on Wednesday. Mr Trump held a news conference, where he belittled a young black female correspondent for public television, and got into an angry exchange with a CNN journalist.

Barack Obama urged Americans not to be "separated by our differences, but bound together by one common creed". ( White House: Pete Souza )

Meanwhile, Mr Obama posted on his Facebook page a message, under an old photo of him smiling as he reaches out to shake a child's hand, that reads:

"Our work goes on. The change we need won't come from one election alone — but it is a start. "And I'm hopeful that going forward, we'll begin a return to the values we expect in our public life — honesty, decency, compromise, and standing up for one another as Americans, not separated by our differences, but bound together by one common creed."

If his election season participation is any indication, Mr Obama will be there to again guide the country that he once governed, making sure that his political garden grows in the orderly fashion it once did.

Micheline Maynard is an American author and journalist.