By the seventh century B.C., the Chinese already knew about building walls. The Warring States Period lasted from the fifth century B.C. to 221 B.C. During that time, states build huge fortifications to protect themselves from other kingdoms. But the Chinese weren’t just fighting each other. They were also defending themselves against nomads from just north of present-day China.
The biggest threat was the Xiongnu. They ruled an empire that stretched beyond the borders of modern-day Mongolia. Because they lived in the desert, these tribes didn’t have many basics and luxuries found in Chinese society. So the Xiongnu raided and looted Chinese cities. They were considered very dangerous. That’s why the first Emperor of China, Qin Shi Huangdi, ordered a great wall built to protect his empire from Xiongnu attacks.