A provocateur took over the White House in January amid calls to delegitimise and penalise China. Yet Beijing has maintained a calm, cool demeanour, and is seeking quietly to find a modus vivendi with the Trump administration. China deflected calls to take on global responsibilities for years, but Xi Jinping ( 習近平 ) became the first Chinese top leader to attend the World Economic Forum in Davos in January, and claimed the mantle of leading globalisation as the US slumps away from that role.

How do we explain the twists and turns in behaviour? On the US side, most of what is happening is transparent. Donald Trump ran an outsider’s campaign and now seeks to upend many of the establishment’s sacred cows. Subject to constitutional checks and balances, however, Trump is increasingly likely to be hemmed in and restrained by realities as his term plays out.

In China, by contrast, politics is mostly conducted in a Beijing black box, and I think what we are seeing from outside that box is the empowerment of Xi. To paraphrase Winston Churchill after the battle of El Alamein, we are witnessing not the beginning of the end, as Xi enters his fifth year in power, but the end of the beginning. Beijing is saying goodbye to Xi Jinping Operating System 1.0, and orchestrating the roll-out of Xi Jinping 2.0, to finish his consolidation of power later this year at the 19th party congress. Unlike American presidents who tend to weaken with time, Chinese leaders tend to do the opposite.

China is deploying its soft power internationally to maximise Xi’s hard power at home and abroad. Xi was hemmed in by compromises struck among his predecessors before he took over the party leadership in 2012. He was saddled with a Politburo Standing Committee largely not of his own choosing. The party bureaucracy was riddled with people who did not support or would not enthusiastically implement his agenda. Promises of reform were blunted by failures to respond. But from the start, Xi could be seen crowding out potential rivals for key roles. He became the Chairman of Everything.

Clearly, that situation is set to change. Since the middle of last year, close observation showed that new officials are being promoted. Xi is repositioning loyalists and those who will become loyal to him so as to govern with a firmer hand in his second five-year term in office.

For the short term, certainly this calendar year, this is probably good news for the rest of the world as Xi plays the role of a world leader. Thus we saw Xi break with precedent to attend the Davos summit, adopting a striking – and many would say a hypocritical – globalist tone in contrast with Trump’s new economic nationalism.

Then we received the announcement of Xi’s first presidential phone call with Trump, in which Xi persuaded Trump to honour the “one China policy”, after the US leader called this sensitive policy foundation into question in December. This was followed by a successful visit to Washington by State Councillor Yang Jiechi ( 楊潔箎 ). All signs suggest preparations are being made for an early Xi visit to the US.

Such a visit would give Xi the opportunity to show his people that he can manage successfully the most important and sensitive bilateral relationship in the world. It would follow the “two sessions” – the annual meetings of the National People’s Congress and the Chinese People’s Political Consultative Congress – now under way, where Xi is demonstrating his role as “the core” of the Central Committee of the party.

Other big stages this year for the roll-out of Xi Jinping 2.0 will be the “One Belt, One Road” summit of more than 20 leaders in May, hosted in Beijing by Xi to showcase his most important foreign policy innovation to date. This will be followed by events in Hong Kong marking the 20th anniversary of the city’s reversion to the mainland, which Xi is expected to attend.

The leaders of the G20 nations will meet midsummer in Hamburg, Germany, beset by America’s new policy directions and a rise in nationalism among many of their home electorates. Xi will be well positioned to stand in confident contrast with many of his counterparts.

This must be a welcome platform for Xi as he prepares to launch into the annual informal leadership meetings in Beidaihe, in August, the final stage of preparation for this autumn’s 19th party congress.

As I noted above, this is probably mostly good news for the outside world, as China’s leader tries to put his best face forward.

But there is another edge to this sword. A leader with such sweeping claims to power and authority must also vigorously defend China’s most sensitive interests against perceived insults.

If, for example, Trump throws up punitive tariffs and barriers to trade against China, we should fully expect Xi and China to reciprocate. If China senses an erosion of its principles on the sensitive issues surrounding Taiwan and the East and South China seas, we should not be surprised if Xi lashes out in response.

And when the second term of party general secretary Xi begins at the end of the year, we should remember that he will already be empowered and less in need of demonstrating his diplomatic savvy and more in need of demonstrating results.

Some of that could be very uncomfortable for those of us outside China.

This article originally appeared in the South China Morning Post.