Walls are a type of Fortification. They turn a District into a Fortified District. All of a Settlement's Fortified Districts must be controlled to capture it.
Wall defenses increase a District's health by 100. When a Unit attacks a Fortified District, combat is resolved by taking the attacking Unit's strength and comparing it to the defense strength of the District, which is calculated based on the strongest melee unit trained by the District owner minus a set value (10). Walls and all City or Town Centers deal reciprocal damage to melee attackers, defender first. Multiple Fortification Buildings on a tile stack their health, such as Walls on a Fortification Wonder.
Players can build Walls in Cities or purchase them in both Cities or Towns. Walls can only be purchased with Gold in the City Center. Walls in Districts can be constructed one tile at a time from the City build queue, using Production. Walls cannot be constructed on Navigable River hexes and must be built adjacent to other Walls from the same Settlement, starting with the City Center. Walls cannot be built adjacent to Walls owned by a different Settlement, except in the City Center, which is always allowed. Walls cannot be constructed on Rural tiles.
Walls from the previous Age provide only half the defense bonus and half the District health, while Walls older than one age provide no benefit. However, Walls from the previous Age can be upgraded by overbuilding them with the current age defenses. Walls are not repaired through the City production queue; they automatically repair over time as long as they are not under attack and have no adjacent enemy Units.
Tip: To capture a Settlement, attackers must gain control of any Fortified Districts. That includes the City/Town Center, any Districts with Walls, and some types of Wonders.