Given the collapse of Rome as a powerhouse of Italy through the 1st millennium CE, when and how did it return to being the preeminent city of Italy? In particular, what factors led to it eventually becoming more prominent than it's major Northern competitor cities, eg: Milan and Venice, that were booming in the first half of the 2nd millennium?
While estimates of Rome's population at the height of the Empire run anywhere between two hundred thousand to one million, the city would only begin to approach the lower tail of these estimates (200,000) halfway through the 19th century. Indeed, upon Italy's unification in the 19th century, Rome would become the political and administrative heart of the new Italian Kingdom, creating conditions for industrialization, attracting a multitude of new inhabitants, and ultimately transforming the existing slow and steady growth into a more rapid demographic explosion. The city would surpass the upper tail of it's ancient population estimate (one million inhabitants) sometime in the 1930s, when the size of the Fascist state attracted even more prospective government workers to Rome, and enshrined the city as Italy's most populous.
It is true that this represented a significant rebound from the city's low point at the Roman Empire's end over a thousand years earlier. But although in the immediate aftermath of the end of the Empire the city definetely had a much diminished role in the governance of the Mediterranean, Rome and its immediate hinterland continued to be the most important center in Central Italy up until the emergence of a Papal State in the seventh century, after which the Rome-based Papacy would become an influential player in European politics and consecrate its capital as one of the most important cities in Italy (indeed, the role of the Papacy was instrumental since other urban areas were growing faster in terms of population and productivity in the early modern era).
So while the city experienced a precipitous drop in population following the definitive end of the Roman Empire, once the city's role was reinterpreted it again began attracting new residents thanks to its retained status as an important religious and political center. It's true the first post-Roman monarchy in Italy neglected the city, preferring locales in the country's northeast like Verona, Forlì, and famously Ravenna. But these trends encouraging rapid population decline would reverse over the course of the 6th century. During the conflicts through which the Byzantine Empire would try to assert itself on the peninsula (or, some would say, "reassert" itself) the city of Rome would become one of the focal points of this renewed imperial presence. The "Duchy of Rome," like the lagoon communities that would beget the city and state of Venice, benefited from the protection of the Eastern Empire while the rest of the peninsula was in the throes of a devastating war. The interaction between the Bishop of Rome, Byzantine authorities, and other foreign agents would also lay the groundwork for the Papacy's importance in European Politics.
In all of Italy in the early middle ages there was an enormous overlap between religious and secular authority (much as there had been in the days of the Roman Empire). The Roman bishopric, that is to say the later Papacy, already commanded enormous prestige prior to the assertion of its primacy over the Catholic Church. Subsequently, Papal recognition and Papal coronations would be major legitimizing tools used by almost every extensive empire to be formed in Western Europe. So while in the rest of Italy newer institutions and governance structures would, over the centuries, supersede the old basilica-centered systems of government (and eventually divorce religious investiture from almost all political authority) in Rome religious authority continued to be synonymous with political authority. So while the city's importance might never have approached that which it enjoyed during the Empire, its role as the seat of the Papacy and the capital of the Papal State was more than enough to keep the city relevant and justify the attraction and retention of new inhabitants from all walks of life. This also awarded the city a relevance which would outlast the Italian Renaissance: as the great powers of Europe fought the Italian wars, devastating the country and setting back the development of other urban communities, Rome instead registered a significant demographic growth, growing from 50,000 residents in 1550 to 100,000 in 1600.
At the moment of the unification of Italy, Rome was the third largest city in Italy. The largest city in the country was Naples, with an estimated 400,000 inhabitants. The capital of the Kingdom of the Two Sicilies, Naples had experienced rapid growth concurrent with the reconstitution of that state's autonomy at the start of the 18th century (the Kingdom had been spun off from the Spanish Empire after the War of Spanish Succession, however Naples had already been the largest city in Italy at least since the Italian Wars, when it was the major base of operations for the Spanish Empire's ventures on the Italian peninsula). Initially conceived as a very centralized polity, the Kingdom of the Two Sicilies quickly degenerated into a very Naples-centric state, its monarchy disproportionately dependent on its largest city while allowing an antiquated legal and political system to work to the detriment of other urban areas. Naples would continue to grow and to be the economic focal point of the South (indeed, disproportionately so) until the 1930s, when it was surpassed by Rome.
At the time of Italian Unification, Milan was also larger than Rome in terms of population and ranked second to Naples. The city experienced a true demographic explosion as it enshrined itself as the country's foremost industrial center during the first phase of the industrial revolution, nearly doubling in population between 1800 and 1870 (from an estimated 135,000 to around 260,000; in fact in 1800 Palermo was slightly larger than Milan, but being a city in the Kingdom of the Two Sicilies its potential for industrial-era growth was largely neglected). Milan continued to experience rapid growth over the course of Italy's industrial development under unity, registering a particularly astounding jump in population during the urgent strides in industrialization made during the First World War, going from 580,000 inhabitants to over 800,000 in less than a decade (and thus surpassing Naples). Like Naples, Milan would be surpassed by Rome during the state-building push of the 1930s.
An interesting case is that of Venice, which I've written about extensively in the past. Estimates find that the city's population had not moved far from the 150,000 mark between the Renaissance (when it was Italy's largest city) and Italian Unification; a peculiar quirk, but one symptomatic of a long stagnation. Slow demographic growth would be achieved after unification thanks to generous top-down economic development and social housing policies as well as the convenient agglomeration of growing mainland communities to the city council's area of responsibility (adding population and their tax revenues). However, the residents in the old city center, after an initial growth hitting a peak of 170,000 by the 1950s, fall continuously and reach 100,000 inhabitants by 1977, and 67,000 by 1998.
Another interesting urban area is that of Florence, which for a few decades in the 14th century was Italy's third largest (behind Venice and Milan, with 100,000 inhabitants). This is certainly a reflection of the city's political and economic apogee, however in the following two centuries it would seem that consecration of Florentine political leadership and control over Tuscany (with the concurrent development of a unitary, albeit despotic, Tuscan state) would redistribute productive forces and population among the other centers in the region. Florence would register 40,000 inhabitants in 1450 (a decline probably also helped along by the Plague) and from there slowly crawl to 80,000 by the time of Italian Unification. The population of Florence would double thanks to the subsequent industrialization process, however by then other cities in Italy had already experienced larger and faster demographic growth.