It’s an interesting question. By some estimates, the city of Lucca has the most extensive and well-preserved medieval walls in Western Europe. Why this bang-average Italian town of all places?
Well, part of the answer is precisely because Lucca just so happens to be a bang-average place that via a unique sequence of events really wanted to build and preserve a large city wall.
It is worth pointing out that the walls of Lucca are a little anomalous compared to the walls of other Italian cities. The walls you see now were extensively rebuilt in an ongoing process the century after the Italian Wars, a conflict which revealed the supremacy of artillery and had reduced the importance of city walls in military conflicts. So the walls you see today are simultaneously more recent than you might expect, and were pretty much outdated before they were even completed. At the time the walls were completed, most other cities in Italy and in Europe were instead protected by earthworks or low-sloping fortifications and not high walls, with a goal to guard against artillery. These kinds of walls would prove fairly easy to dismantle as cities expanded in subsequent eras. Lucca, on the other hand, not only had truly massive fortifications but subsequently didn’t experience a rapid expansion where the benefits of demolishing the walls outweighed the effort, especially after they were converted to a park and became a major attraction.
Why did the Lucchese build these imposing walls even though they were outdated? There’s no founding manifesto or proclamation they kindly left behind for us to consult, unfortunately, but building walls with an outdated plan is a reaction you might expect from a small and peripheral Italian state after the Italian Wars. This is especially true as the Florentine state immediately to the south of Lucca wasn’t exactly one of the more successful Italian powers in pure military terms, but had proven itself successful enough as a local power in its ability to consolidate all of Tuscany (if the fate of Siena and Pisa was any indication). So the 16th century Lucchese stuck by plans they had drawn up at the end of the previous century (with a few modifications and adaptations along the way) and built truly massive city walls that were a deterrent and a signal more than anything else: ye florentines heed that this is the extent of the effort they would undertake to defend their autonomy. The walls are a statement, so much so that until the 19th century there wasn’t even a gate in the wall facing Florence, forcing travelers from Tuscany’s largest city to circumvent the walls in order to enter the city, reminding them of the Lucchese attitude towards their larger neighbors.
Another indicator that the lucchese might have already understood their walls were outdated as they were being constructed is the unique attention to nature that the various overseers allowed. Sure, the walls are buttressed with earthworks (possibly compensating for the insufficient slope of the outer curtain) but they also allowed trees to line battlements such that they resembled promenades more than a military installation from the start. To some extent the tree roots strengthened the inner earthworks, but they also turned the walls into a comfortable place to take a stroll, predating other Italian cities’ efforts to transform city walls into elevated parks by a couple of centuries. This ensured that the city walls became a part of daily life: well-to-do Lucchese, including local leaders and decision-makers, adopted strolling on the walls as a frequent ritual with two centuries head start on the rest of Italy. Thus even as the military function of the walls was increasingly irrelevant, these uniquely massive walls instead became an important component of lucchese identity, and it would take a serious paradigm shift indeed for local authorities to consider demolishing them.
Did the walls actually work as a deterrent? To some extent they must have, since no Florentine government made moves to annex the small republic (which became a Duchy after the Napoleonic period). But the Lucchese also erected diplomatic barriers against Florentine enrichment that might have made these imposing walls unnecessary: Lucca successfully petitioned to become a Free Imperial City, aligning first with the Charles V’s Hispano-Austrian Empire, and later exclusively with the Austrian Empire once it monopolized the imperial crown. While “Imperial” status was an outdated and mostly irrelevant privilege as Italy hasn’t exactly been a natural component of Imperial politics for several centuries (at least not in the same way that the german parts of the empire were) Lucca’s willingness to link itself to the imperial system offered an additional ideological buttress supporting the Empire on those occasions when its attention returned to Italy, while also allowing the Lucchese to flaunt an additional deterrent against potential Florentine aggressions (Lucca’s pure strategic value, on the other hand, was next to none as far as the Empire was concerned).
And now we come to the second important point as to why the Lucchese walls survived in such a complete form: no one ever really saw a reason to tear them down. Had the Florentines succeeded in annexing the city and its terretory, maybe they would have torn the walls down. If the city had become an industrial center (never a wholly likely scenario) urban growth might have given local authorities a reason to tare down the walls (as happened in Bologna, for example). If the city had become a commercial hub, vehicular traffic might have given authorities another reason to tear down the walls to facilitate transit (as happened in Milan, where walls had spent over a century as a pleasant promenade just as in Lucca when the decision was taken to do away with them altogether). But as fate would have it, none of these things occurred in Lucca. Even after Italian Unification, Lucca remained a medium-sized provincial capital, not particularly different from similarly-sized cities all over the country. Lucca was not without its elegant townhouses and proud bourgeoisie, but on the whole it was an average town in a country that was industrializing late and growing slowly. The slow growth of the city never gave the Lucchese pause to reconsider these enormous walls which had become an important symbol and a component of local identity. So the walls survive to this day.