I've been wondering about this for a while, and just now finally decided to look it up. And, for you lurkers... I deliberately picked a piece that dates back a few years, before the current administration took over. Wikipedia is just too convenient to sling mud at.
Turns out the Wall didn't work. It was fine at first due to the emperor's armies, but, later on, the armies from the north invaded anyway and "and after several skirmishes the Han emperor had to marry off his daughter to the Xiongnu ruler in order to make peace."
One paragraph in the story stands out:
Another argument is that the Great Wall was nothing more than an ambitious project contrived by a vainglorious emperor. The Great Wall was supposed to show the world China’s superiority, making a clear distinction between civilized people and barbarians.
https://gbtimes.com/failure-great-wall
This article also mentions Hadrian's Wall, and a separate article on it (also from years ago) says:
"In both cases, in addition to any military function, the physical barriers served in the eyes of their builders to reinforce the conceptual divide between civilized and noncivilized. They were part of the ideology of empire. (Ancient Civilizations, 313)"
https://www.ancient.eu/Hadrians_Wall/
And yes, I know, both of these articles were written by Democrats with a crystal ball and an agenda.