Globalization reshaped the world economy over the past four decades, linking countries through the free flow of capital, people, and goods to bolster growth and—at least in theory—engender geopolitical harmony. Along the way, it built China into an economic powerhouse, pulled more than a billion people out of poverty, and created a burgeoning middle-class hungry for U.S. goods.