I don't know if the history of the old walls of Toulouse can generalize to other walled cities. I think of walls as fairly permanent structures, but the walls of Toulouse were built, fortified, and demolished at least twice.
The original Roman walls were built in the 1st century. Toulouse was well inside the pax Romana guaranteed by Roman empire, but the walls were erected as a mark of Toulouse's distinction. This wall, roughly three kilmeters long, had three gates and enclosed an area of 90 hetares (220 acres).
In the 3rd century, menaced by barbarians as the empire began to crumble, the Toulousains fortified the Roman walls. The foundations of this wall were built in haste--building materials included fragments of statuary and bas-relief from destroyed buildings. And by the 5th century, Rome had handed over southwestern France to the Visigoths; well-fortified Toulouse became the capitol of the Visigothic kingdom.
Eight hundred years later, in 1213, Toulouse was captured by wicked Simon de Montfort during the Albigensian crusade. de Montfort ordered the Toulousains to destroy their walls, knock down their towers and fill in the moat which surrounded the city. Before the work was finished, a group of Toulousain women lobbed rocks from a tribuchet and crushed Simon de Montfort' skull. This halted demolition for a few years, but in 1229, the peace treaty that ended the Albigensian crusade signed by the King of France and the Count of Toulouse still required the demolition of Toulouse's walls.
Then, just a little over 100 years later, in 1345, the Toulousains were authorized to rebuild their walls. The Hundred Years War had started and this time the Toulousains needed to defend the city against the "Black Prince" and his English armies. These new wall enclosed land that had formerly been outside the city wall (notably Saint-Sernin.)
By the 18th century, these walls were choking the city. Most were knocked down in urban renewal projects in the 1860s. But traces remain.
The first picture is one that I took last summer. This tower is visible from the jardin Royale, and it gives you some idea of how big these towers were.
The second picture is a satellite view from google maps. The red circles are existing towers--the one pictured above is the circle in the upper right corner-- the line connecting them gives you an idea of the placement of the old wall.
The lower tower was incorporated into the wall of a prison, Haut-Murat (third photo) The building is from the 19th century and had a tower at both ends. One remains but the other is a shell (last photo)