President Donald Trump’s visit to China during the past few days and meeting with his Chinese counterpart, President Xi Jinping, have been of exceptional importance, given the constant strain on the relationship between the two countries over decades. The tension is palpable, as is almost everything in politics and economics. But that did not stop the two parties from meeting and doing business. Trump agreed to invest $250 billion in China, which was no small sum given the hostility between the two leaders.

What is driving Trump’s visit to China? Why is he reverting to the economic positions he held during his campaign? Why is he still attacking his political enemies, including his predecessor, President Barack Obama?

Trump’s positive rapport with President Xi may be what is causing a closer relationship between the two countries, despite the policy disagreements. Trump has praised the man on more than one occasion since they met in April during the U.S. summit. China concerns the United States more than any other nation, primarily due to North Korea’s nuclear program. Trump’s major challenge is determining how to contain Pyongyang’s nuclear program, which threatens the whole world and not just the United States.

Trump is betting on a Chinese intervention to prevent the world from witnessing a nuclear conflict that no one can predict. He seemed optimistic about Beijing’s ability to play this role because of China’s influence on North Korea. He hopes China will be the honest broker that will de-escalate the conflict with Pyongyang.

The U.S. bet on China is based upon an evolving personal relationship between Trump and Xi, who was recently re-elected leader of the Chinese Communist Party for a second term, giving him more flexibility in addressing domestic and foreign issues, such as the nuclear crisis with North Korea. This, in turn, is pushing China to the forefront of the world’s thorniest issues.

The nuclear crisis with North Korea was not the only issue present during Trump’s visit to China. The visit also featured economic agreements. Trump’s $250 billion investment in China was miraculous, to use the term employed by Chinese Commerce Minister Chung Chan to express the great economic collaboration between the two countries.