The Great Wall of China was built during the Zhou Dynasty and expanded during the Qin Dynasty as a protective barrier. It was meant to act like a man-made mountain range to protect the great Chinese empire. As a bit of a rule, the Chinese people have always been more introverted than extraverted, especially in the earliest days of the dynasties and the empire.
Foreign influence has always been considered a bad thing, and part of the reason the Zhou and Qin dynasties wanted to have a barrier was to keep “dirty foreigners” out of their country. This didn’t stop the British or the western colonization powers, but it did stop the Mongolians for a few centuries, until they had expanded past the Great Wall’s protection, and they had to rethink their defenses.