China is constrained by its reliance on western markets. Full stop. It would hurt to pull the plug, but if they cross a line it will happen and they know it.
Xi (more so than his predecessors) is quite happy to take a short term loss for (what he sees) as a long term gain. In addition, he would love to be remembered in history as the man he reunified China.
Basically, if we "built the wall", they'd still have all the stuff, and we'd have increasingly more worthless numbers in our bank accounts.
Relying on one country for most of our production needs is stupid.