It didn't. Yes, the gap certainly has widened with countries that didn't partake in globalisation. Here I'm thinking countries in Africa, North Korea and Afghanistan.
But if you look at poorer countries that did invite the richer ones so that could provide labour at a lower cost, countries like Vietnam, Thailand, South Korea, and yes China - the gap has gone from peasant farmers who starved in lean years to industrial nations that are starting to rival the incumbents. Places like Singapore and Japan are in fact now wealthier than most of the incumbents.