Historically, walls have traditionally been understood as a measure of protection, designed to keep any threats to the society out. The image of a mighty stone construction, surrounded by heavily armoured guards fighting to protect the people from the invaders is easy enough to understand and has captured the imagination of many cultures.
However, there is a darker side to this protection, what keeps one out can after all be used to keep one in. It doesn't take much thought to imagine the towering walls as ominous symbols of control, surrounded by heavily armed thugs willing to kill at the slightest hint of disobedience.
Sometimes the cities and lands around are surrounded by impenetrable walls, not to keep the people safe but to ensure they cannot escape or resist. After all, walling of the city ensures not only a vast restriction on movement but also that any supplies and resources can only be moved in with the permission the overlord, enabling whatever taxation they may chose and even a total blockade in the event of civil disobedience.
The restrictions on who may enter also aid to the control over the spread and flow of information, preventing the incursion of any ideas that would be unwelcome by the ruling regime and making it easier to distribute their propaganda.
The walls do not necessarily need to be impenetrable to fulfil this trope, sometimes it might even be relatively easy in practice to escape, sometimes they are more a symbolic, acting as a deterrent to even seek the outside world.
Can overlap with Fantastic Ghetto if the walls that are used to cage in the inhabitants are emphasised.
Compare The Great Wall, when the focus is upon the wall itself rather than what it represents, and The Wall Around the World, when the focus is instead upon the mystery of what exists beyond the wall. Contrast Citadel City, when their presence of walls is portrayed positively (or at least neutrally) with the presence being clearly for defence and protection of the city and its citizens.
Due to differing politic opinions on what counts as oppression vs justified protection, No Real Life Examples, Please!.
Note: To qualify for this trope, the walls themselves must be presented as a tool of control and despotism, rather than any settlement with an oppressive regime that is surrounded by a wall.
- Attack on Titan The walls are supposedly meant to protect humanity from the Titans, but the upper class citizens safer within the inner walls. The wall's true purpose is to keep the Eldian people corralled in the same area so that they will be eventually be wiped out, given that the First King who created the walled city believed that his people were cruel oppressors that needed to be wiped out in atonement.
- Judge Dredd: To stop the mass-exodus of his subjects into Cursed Earth, the homicidally tyrannical Chief Judge Cal has a great wall built all around Mega-City-One... using slave labor, of course. Played with in that not only does the wall drastically outlive its creator, but it then immediately ceases being this trope and becomes an actually useful defensive measure. Being surrounded by irradiated, mutant-infested Death World surely does not hurt in that.
- Legends of the Dead Earth: In Batman Annual #20, New Gotham is surrounded by a dome. The City Controllers tell the populace that it is for their own protection as the air outside New Gotham is poisonous. However, this is not true. The dome was constructed for the sole purpose of keeping the people inside the city
- The Legend of Wonder Woman (2016): The wall around the city of Themyscira was constructed not to protect the inhabitants but to help prevent them from considering leaving, as their forced continued worship of the Olympians is the only thing preventing the Olympians from fading away entirely. When the Amazons rebel against Zeus' plan to massacre millions and expand his worshipers through force he slaughters most of them and isolates them further by placing Themyscira in space.
- The Lorax: Thneedville is surrounded by a wall that entirely obscures the view of the outside world. In this case it's there not only to keep people in, but also to keep them unaware they are living in a polluted wasteland caused by the actions of O'Hare and Once-ler, to the point that wall is painted to give the illusion of a clear blue sky surrounding the town..
- Bridge of Spies: The Berlin Wall receives this treatment, its construction being presented as a sign of the strengthening of USSR, and the increasing oppression within in GDR. The timing and circumstances of its construction preventing Fredrick Pyror from getting his girlfriend out of East Germany, and leading to him also being trapped.
- Goodbye Lenin: Zigzagged. Alex is clubbed by the authorities whilst attending a protest demanding that the Berlin Wall be torn down. However while his mother is in a coma, the wall does come down. However, following the many changes this causes Alex begins to show some signs of nostalgia and wonders if the wall really was protecting him.
- Escape from East Berlin, directed by Robert Siodmak, was the first of many films in which the Berlin Wall was a symbol of oppression. It was released in late 1962, and was based on a real escape that took place in early 1962, after the Wall was finished in mid-1961. Not that the Wall is a Real Life Example, of course.
- Dragon Lance: A particularly nasty variation occurs, Cyan Bloodbane is an especially malicious and selfish green dragon, who possessed an incredible hatred for Elves. Having almost succeeded in destroying the Elven Kingdom of the isle of Silvanost before, upon gaining a magical totem that disguised him as an elf he returned with a sadistic plan. Playing on the Elves growing xenophobia and paranoia, he convinced them to set up "the Shield" a magical barrier that would ensure no one could enter their kingdom or leave. However, Cyan failed to tell them the Shield would slowly suck the life out of the land, and the animals, and the elves themselves. Dooming them all to a slow painful death.
- Interesting Times: The great Agatean Empire has one stretching around it (up to the Rim sea, and then continuing on the islands as the idea of wall is more important than the physical barrier) officially it is to protect the Agatean people from the ghost vampires wastes outside, but in reality it is to ensure that they cannot escape, forcing them to continue living in the corrupt and oppressive regime of the empire, as well as blocking all knowledge that their leaders feel would be corruptive from entering.
- We: The Green Wall separating the civilization of the One State from the forests around it, which in turn separate them from the rest of the world. Whilst its never made clear what exists beyond it, its implied it exists to keep the citizens from leaving. The Wall serves as much a piece of propaganda as a functional barrier, in that it constantly reinforces the One State's claim they are the only civilisation and makes defection seem to be suicide.
- Curfew: A variation. A massive wall has been built surrounding London, it officially exists to keep the Mooks out, however, as it clearly doesn't work it instead only keeps the people in. Due to the increasing oppressive nature of British government, its not clear if it was built for defence and failed, or if it was always intended to tighten control of the populace. Getting past it is one of the major obstacles of The Race.
- Wayward Pines: The entire town of Wayward Pines is revealed to surrounded by a giant inescapable wall topped with an electric fence (save a small portion where a cliffside serves as a natural barrier) that will kill anyone who touches it separating them from the outside world, thus enabling the town to operate as a police state with it being impossible for the people to escape. Matters get more nuanced however, when its revealed the Wall is really to keep the Abi's from getting in and killing everyone.
- Twenty One Pilots: The song "Chlorine" includes the lyric "I plan my escape from walls they confined", wherein the walls represent the dystopian city of Dema.
- Hadestown: A variation, the residents of Hadestown are continuously building a wall around themselves, ostensibly to keep out the poor and destitute. The irony is, they would be poor and destitute themselves if they didn't have a wall to build, as exemplified in the accompanying song "Why We Build The Wall". Really the whole thing is just another way for Hades to get them toil away their lives in his oppressive service.
- Half-Life 2: The Combine use mechanical, mobile walls to section off their holdings on the Earth. None of them are for the betterment of humanity; either keeping humans contained like cattle in pens, slowly constricting as the population inside them is killed/converted into transhumans and shipped offworld, or slowly and inexorably expanding outward into unclaimed territory. They do not need guards, as they are completely indestructible through anything earth-made, and both types crush whatever used to be where they move to, buildings included, while emitting a horrible metallic grinding - leaving no one wanting to even approach them.
- Sleepless Domain: Anemone discusses this concerning the barrier protecting the city in an Interstitial:
Anemone: Sometimes, I wonder if we really need the Great Barrier. [...] We all know it keeps the monsters out. [...] But am I really the only one who cares that we can't go outside?
- Æon Flux: Two bordering states, the anarchistic, libertarian Monica and the totalitarian Bregna, separated by a heavily fortified wall, which the oppressed citizens of Bregna regularly try to cross. The wall is featured most significantly in the episode "Thanatophobia".
- All Hail King Julien: In "Run For The Border", taking advantage of King Julien's growing annoyance at all the other animals that have moved into the Lemur Kingdom (which he himself original invited in efforts to strength diplomatic relations), the LALA (Lemur Alliance Liberation Army) tricks the Lemurs into building a giant wall around the kingdom supposedly to keep out the foreigners. Manipulating the lemur's habit of not thinking ahead, they have the Wall built with no doors and the only way out by catapult, thus making it easy for them overthrow Julien and oppress the Kingdom.
- Avatar: The Last Airbender: The walls of the Earth Kingdom capital of Ba Sing Se were ostensibly constructed to protect the city from invasion. In reality, their main function is to discourage residents, including the Earth King himself, from leaving the city, where they might discover that the rest of the Earth Kingdom is being invaded by the Fire Nation. The inner and middle walls also serve as symbols of classism, keeping the poorer population away from the middle and upper classes. In Sequel Series The Legend of Korra after the Red Lotus kill the Queen they tear down the wall separating the Lower Ring from the rest of the city, resulting in mass looting and rioting.
- Clone High: Parodied in the musical episode where Principal Scudworth takes advantage of the PTA's panic over the raisin epidemic to convince the parents that they need to build a fence to keep their kids from smoking raisins.
- Ducktales: A variation occurs in "The Living Mummies of Toth-Ra", Pharaoh Toth-Ra had a number of his subjects, dubbed the Living Mummies form a hidden civilisation inside his pyramid deep in the darkness to carry on serving him in death. Their descendants still live there in the present, barely surviving and being completely dependent upon the Pharaoh to give them a few minutes of sunlight each time for the crops they need to survive. Its revealed Toth-Ra is really dormant and its actually the descendant of his bodyguard Sabaf and his ancestors which have been enslaving the people all these millennia, by using the Pharaoh's body as a puppet.