Trump was not the only factor behind the agreements, but his shaking up of the global order is worrying friends and foes and driving them closer.