Nikki Haley’s resignation as U.S. ambassador to the United Nations was as mystifying as her appointment was surprising. There was basically no advanced notice that the former Republican South Carolina governor was thinking about leaving her post, let alone announcing it less than a month before Americans go to the polls to elect a new Congress. Pundits will spend the ensuing 24 to 48 hours wondering why she decided to quit: was she on the outs with President Trump; did something dramatic behind the scenes happen that hasn’t yet been disclosed; maybe she really was the anonymous author of that New York Times op-ed describing Trump as a reckless and bumbling fool close to taking the country off the cliff?

[Related: Nikki Haley is going to run against Mike Pence in 2024, not against Donald Trump in 2020]

What we don’t know is why Haley left, although she claimed she needed a break after nearly two years wheeling and dealing in the Security Council chambers, preceded by six years as governor of South Carolina. But what we can say with a fair amount of confidence is that Haley is not going to leave politics. A 2020 presidential run is out of the question, but 2024 or 2028 is not that far behind.

It was always a mystery to me why Nikki Haley joined the Trump administration in the first place. During the 2016 campaign, she never thought Trump was presidential material. On multiple occasions, Haley made a plea to voters to reject the loud, angry, anti-intellectual populism that Trump represented. She condemned Trump for “irresponsible talk,” and Trump hit back by calling the governor “weak on illegal immigration” in the form of a typical politician.

And yet, despite the verbal jousting, Trump asked Haley if she wanted to take charge of the U.N. portfolio. And just as miraculously, Haley accepted – as long as she could speak her mind and be given a seat at the big table.

Haley was smart to take the job, and not just because the most important ambassadorship is a great resume builder for a future White House run. Tucked away in New York, she was able to dodge the never-ending turmoil of Washington and the near-anarchy that hovered over the West Wing. Name a scandal – the amateur rollout of the Muslim Ban, the Mueller investigation, the Fire and Fury chronicle, Bob Woodward’s explosive book, the backbiting intramural fights among White House staff – and Nikki Haley has been able to rise above it.

Whether true or not, she has successfully created an image of a responsible, level-headed principal officer of an oftentimes confusing and disorderly administration. Not a bad character to embrace for the 2024 election.

Daniel DePetris (@DanDePetris) is a contributor to the Washington Examiner's Beltway Confidential blog. His opinions are his own.