The English word 'Wall' is derived from the Latin, vallus meaning 'a stake' or 'post' and designated the wood-stake and earth palisade which formed the outer edge of a fortification. The palisades were in use early on and are mentioned by Homer in the 8th century BCE and later by the Greek historian Polybius (c 200-118 BCE) and the Chinese historian Sima Qian (145-86 BCE) among others. Walls have traditionally been built for defense, privacy, and to protect the people of a certain region from the influence or perceived danger posed by outsiders.
Walls of different cultures all served this same primary purpose but were constructed in various ways using diverse materials depending on the culture and the time period. Walls in ancient Mesopotamia were sun-dried mud-brick, as they were in rural areas of ancient Egypt. Walls around sacred or ceremonial sites in Egypt were eventually made of stone. Work in stone was also practiced by the Greeks and famously by the Romans, best exemplified in Hadrian's Wall in modern-day Scotland, which was constructed starting in 122 CE. From the time of the Roman Empire onwards, stone was the material of choice in wall-building up through the modern era.
Ancient Walls of Mesopotamia
The oldest walls found in existence so far are those of the temple of Gobekli Tepe in Urfa, southeast Turkey which date to 11,500 years ago. City walls, which became common for purposes of defense, are first seen around the city of Jericho (now in the West Bank) around the 10th century BCE and the Sumerian city of Uruk which was founded somewhat later (though both cities lay claim to the honor of `first city in the world'). The walls of Uruk were thought to have been built by the great king Gilgamesh upon which he inscribed his heroic deeds which formed the basis for the later epic he is most famous for.
Walls began to rise around cities throughout Mesopotamia shortly after urbanization began in the region c.4500 BCE. City walls were constructed to include gates and watchtowers and usually a ditch running around the outer perimeter of the wall which could be filled with water. King Hammurabi (r. 1792-1750 BCE) surrounded his city of Babylon with more impressive walls than usually seen shortly after he assumed the throne in 1792 BCE, but the credit for transforming the city of Babylon into an awe-inspiring wonder belongs to King Nebuchadnezzar II.
Nebuchadnezzar II (r. 605-562 BCE) built three walls around Babylon at heights of forty feet and so broad at the top that chariots could race around them. The Ishtar Gate in the wall of Nebuchadnezzar II's Babylon was claimed by some to be greater than any of the listed Wonders of the Ancient World. The Greek historian Herodotus claimed that "Babylon surpasses in wonder any city in the known world" and specifically praised the walls which he said were 56 miles (90 kilometres) long, 80 feet (24 metres) thick, and 320 feet (97 metres) high. Although it is generally believed that Herodotus exaggerated the majesty of Babylon, other ancient writers have also noted the magnificence of the walls.
Defensive Walls
It is thought the very first wall not built around a city was erected by the Sumerian King Shulgi of Ur (r. 2029-1982 BCE) in c. 2038. Shulgi's wall was 155 miles (250 kilometres) long and was built between the Tigris and Euphrates rivers to keep the invading Amorites out of Sumerian lands. This wall was unusual in that it did not surround a city but, rather, marked a territorial, national (rather than private) boundary and, as such, was a first of its kind.
Shulgi's son, Shu-Sin, grandson, and great-grandson all tried to maintain this wall but, as it was not anchored at either end to any terminus, proved to be ineffective (one could simply march an army around either end of the wall) and finally was breached by the Elamites c. 1750 BCE resulting in the fall of Ur and the region of Sumer. Another wall of this kind, still extant, is the Great Wall of Gorgan (known as `The Red Snake' due to the red color of the bricks) in modern-day Iran. Built by the Parthian Empire (247 BCE-224 CE) it was restored and renovated by the Sasanian Persians in the 5th or 6th century CE, the wall runs 121 miles (195 Kilometres) long and included over thirty forts along its line.
The wall was built as both a defensive construct and a strategic means of observing enemy deployment. It was far more effective than Shulgi's wall and it is thought that the Sasanian Persians learned the lesson of Shulgi's wall and improved upon their own. The Great Wall of Gorgon is over 1,000 years older, though far less famous, than the Great Wall of China which, though begun under the reign of Shi Huangti (ruled 221-210 BCE) was not completed in its present state until the time of the Ming Dynasty (1368-1644 CE). Like the Great Wall of Gorgon, the Great Wall of China was built as a free-standing structure for defense of a region as was the Anastasian Wall (also known as The Long Walls of Thrace) of the Byzantine Empire (begun c. 469 CE) located in modern Turkey.
Walls in Homes and Cities
The Neolithic village of Banpo in China (inhabited c. 4500-3750 BCE) consisted of stone-walled circular houses supported by timber with thatched roofing while the village of Skara Brae (in Orkney, Scotland) was built in 3100 BCE with walls and houses of stone to protect people from the elements and provide privacy. Interestingly, both villages are similar in construction. The basic form of these villages, and the use of walls, continues along the same lines in other cultures.
In ancient Egypt most private homes had walled courtyards to help deter robbers or simply unwanted and uninvited neighbors (papyrus scrolls and tomb inscriptions relate that human beings could be as insufferably annoying to each other in ancient times as they are now). Every city in ancient Egypt was walled and each of the great palaces had elaborate painted walls for the purpose of defense, but also for ornamentation.
This same building pattern held true in ancient Greece where citizens of Athens built small decorative walls around their courtyards and patios. The Athenians also surrounded their city with thick walls which lasted until the end of the Peloponnesian Wars with Sparta when the victorious Spartans had them torn down. Also of note in Athens were the Long Walls which were two parallel stone structures which ran from the Acropolis down to the port of Piraeus and protected the center of the city.
The walls of the fabled city of Troy from Homer's Iliad were uncovered by the archaeologist Heinrich Schliemann during excavations between 1871-1874 CE and served this same defensive purpose. The fortifications of the Chinese city of Xi'an (built c. 194 BCE) were also constructed for defense and lasted four years before falling. The modern day walls of Xi'an, like the Great Wall of China, was re-built and restored by the Ming Dynasty.
Walls in Europe & Hadrian's Wall
In Europe the custom of the walled city continued as evidenced by sites such as the Oppidum of Manching (located near modern-day Ingolstadt, Germany) which was a 3rd century BCE Celtic community of the Vindelici tribe. The Roman city of Lugo in Galicia, Spain was surrounded by enormously thick walls considered utterly impregnable. The most famous wall of antiquity in Europe, however, is Hadrian's Wall in Britain.
The Roman Emperor Hadrian (r. 117-138 CE) grew tired of incursions into the Roman provinces in Britain and so, in the year 122 CE, began building a wall across the northern border of Roman Britain to separate it from the invading Caledonian tribes much in the same way that Shulgi built his wall almost two thousand years earlier to keep out the Amorites (as with the Great Wall of China and the Anastasian Wall). It took six years to build, stretched for 80 miles (128 kilometres) across the land, and was, at points, over nine feet wide (2.7 metres) and twenty feet (6 metres) high. It was fortified by towers along the way and served as a symbol of Roman military might and power.
The later Antonine Wall (begun in 142 CE under the reign of the Roman emperor Antoninus Pius) stretched 39 miles (63 kilometres) between the Firth of Forth and the Firth of Clyde and was constructed for the same reason as other such walls: to protect the known region of the inhabitants from the incursions of the `other' whom they regarded as dangerous barbarians.
Conclusion
Walls, as noted, have always served the same basic purpose and, at the same time, have always shared the same weakness: anyone who really wants to get around a wall will find a way to tunnel under, go over, or walk around one. The Great Wall of China was initially useless in stopping the nomadic cavalry of the Xiongnu and only became the formidable structure it is today many centuries later. As noted, Shulgi of Ur's wall was easily breached by the Elamites simply walking around it and Hadrian's Wall did little to stop illegal immigration as evidenced by Caledonian artifacts found amidst Roman pieces, suggesting Pictish merchants trading with (or bribing) Roman soldiers.
No matter how pointless a wall might be in terms of defense or limiting access of `the other' to one's lands, walls have continued to be built, and often fortified, since Roman times in an effort to make the populace feel more secure. Like Hadrian's Wall, walls in general are symbolic in marking one's space as one's own and limiting access to others, by way of a physical statement, in order to feel more secure. It has never seemed to occur to people that what they are walling out might be more beneficial than harmful to them in the long run but human beings are notoriously short-sighted and largely fear-motivated and so it is almost a certainty that walls will continue to be built, separating nation from nation and neighbor from neighbor, on into the future without end.