The northern Italian states were strong and developed during the middle ages and peaked in the Renaissance. What happened?
Short answer:not on the Atlantic, in an Atlantic age. More a collection of merchant city states than a nation. The "decline" is mostly relative . . . in an age when Northern and Western Europe prospered, Italy did "more or less the same".
Discussion:
There's a bit of irony that Christopher Columbus was a Genoan, as his discoveries put in play the forces that would lead to the economic eclipse of Italy.
What made Italy rich? Not so much its military strength-- that was considerable, but States like Venice, Florence and Genoa were fairly prudent about military adventure; in their celebrated use of mercenaries, we can see that military force was seen through a practical and commercial lens. And commerce was their real comparative advantage. Venice dominated trade with the East, Florence was financing English wool production, Florentine galleys sailing to England every year to pick up goods . . . this was a massive trade network, centered on the Mediterranean.
"Long distance trade" in the 15th century was Italian galley captains, financed by the Medici and other bankers, sailing across the Eastern Mediterranean, up the coastline of Spain and Portugal, crossing the Bay of Biscay and sailing into the English Channel, trading in France, the Low Countries and England. Similarly Venetian galleys, sailing the Adriatic coast, stopping at trading ports and finally into the heart of the Ottoman Empire. The trade with Northern Europe goes into decline around 1400, but once can still see significant galley trade in the Mediterranean more than a century later.
Venetian Galley route map:
https://www.reddit.com/r/MapPorn/comments/dm65iv/journey_of_a_16th_century_galley_from_venice_to/
But 1492 is the starting gun for the eclipse of the Mediterranean as an engine of trading wealth. Previously peripheral powers like Portugal advance-- and note the importance of geography here, Portugal's imperial success is closely linked to their location. Portugal had been limited world historical importance to that point, but on the periphery of Europe, but a launching point for travels to Africa, the New World and Asia. As a consequence there are hundreds of millions of Lusophones (Portuguese speakers) in the Americas and Africa; and just a few overseas Italian speakers.
Even in a purely European frame of analysis, Italy falls behind. The 17th and 18th centuries are a time of state building, the transformation of ad hoc and local systems into truly national mechanisms of administration-- notably in the France of Louis XIV. While all sorts of advantages in human capital, Italy's systems of governance were anachronistic . . . there can be no equivalent to a Nicolas Colbert, ordering the nation's finances -- there was no "nation" of Italy, and there was no such role.
One could point to strategic factors -- Italy was torn between Spanish, French, Austrian and Ottoman interests. Consider the number of foreign enemies who fight on and occupy Italian territory, and Italy's lack of any national cohesion in response. Napoleon's conquest of Germany in 1808 prompts an effective German nationalism in response; Italian nationalism doesn't really emerge as a politically effective force until the 19th century.
So Italy, having inherited a position that was once fortuitous, found itself ill situated commercially, politically and militarily for the second half of the Early modern era. It isn't so much that anything went terribly wrong for Italy, as that they didn't have a stake in the dynamics that lead to rapid growth and prosperity for Northern and Western Europe; they'd gone from being "the center of it all" to being a relative backwater.
Sources:
Fasano-Guarini Elena. Au XVIe siècle : comment naviguent les galères. In: Annales. Economies, sociétés, civilisations. 16ᵉ année, N. 2, 1961. pp. 279-296.
"The Florentine Galleys in the Fifteenth Century", (Oxford University Press:1967)
Studnicki-gizbert, Daviken. "A Nation Upon the Ocean Sea: Portugal's Atlantic Diaspora and the Crisis of the Spanish Empire, 1492-1640", (Oxford University Press:2007)
While the factors are varied and depend on lens of analysis, the strongest attributions are a combination of political and organizational fragmentation in the face of competition from the larger emergent nation-states of Europe, as well as a political class that preferred association with the aforementioned more powerful outside forces as opposed to self-determination. These two factors colluded to create over a half-century of warfare known as the Italian Wars, eventually resulting in half the peninsula becoming an appendage of the Spanish Empire and crippling the Italian States' capacity to act. Thus political actors on the peninsula were politically dependent on foreign powers, the peninsula's economic class was cut off from the main driver of European economic growth (that is to say, Atlantic Trade), and the peninsula's geographic and organizational subdivisions were to small to envision or require the industrial-era growth which would cause Europe to break away from the rest of the world in terms of the most common developmental parameters.
Of course, the Italian States were not the only European political actors to be small (the Netherlands were also small, but were highly successful), nor were they the only European political actors to be cut off from the Atlantic (so was the Ottoman Empire, who in spite of a narrative of decline would nonetheless by synonymous with Southeastern European geopolitics until the First World War), and they weren't even the only political panorama to be subject to foreign influences and internal divisions (England, France, and Spain would all be subject to destructive Civil Wars, the latter two with significant foreign interventions). But the Italian states were most certainly the only European political panorama to have all three factors acting at the same time.
John Julius Norwich, an older English historian who examined Norman Sicily and the Republic of Venice by way of Byzantium, made a telling remark on Italy after the 16th-century Italian Wars: there is a clear perception that the drivers of broad political and economic changes in Europe were no longer to be found on she shores of the Mediterranean. Indeed less than a century after the Italian Wars, the Italians were bystanders to the conflict that would confirm and define the role of the nation-state in European history, as well as develop the western notion of state sovereignty: the Thirty Years War. I actually wrote about Italy's disinterest in this conflict in a fairly recent post, which you can read here.
It is somewhat predictable that compared to the great nation-states of Europe, the small Italian States had a much weaker capacity to act. What did this translate in terms of real consequences for economic development and prosperity?
University of Gronigen's Maddison Project, a pillar of modern economic history, looks to produce estimates of historic economic development levels. While the values are continuously under revision, the Maddison Project's consistent methodology allows for the extrapolation of broad trends over time. And regarding Italy, what is interesting is that per-capita economic development was the third highest in Europe as late as 1820: 1,511 in terms of 1990 US Dollars (the use of 1990 US Dollars by the Maddison Project is rather arbitrary and born out of convenience, especially as it is estimated that a sustenance-level income at this point was between 400 and 500 per year, which has implications for purchasing power parity). But in addition to comparative values, there is also an important time-series trend that Italian values in the Maddison Project exhibit: per capital income in Italy fluctuated between 1,400 and 1,600 between the 14th and 19th centuries and does not exhibit the broad upward movement that the rest of Europe does. Thus the Italian productive system fundamentally did not change between the Renaissance and Industrialization.
Catch-up of other Mediterranean countries made a small dent in Italian prosperity, and likewise the opening of Atlantic trade didn't cause economic activity on the peninsula to evaporate. In fact, economic activity would continue to take place pretty much as it had always done, and this is exactly the reason for Italy's stagnation: Other European states exhibited gradual economic progress, and in 1850 Maddison's estimates show Germany close to matching the peninsula and France overtaking it (in the next few decades Germany's development would even come to rival Great Britain, which was the most developed economy at the time).
And here we return to the factors I listed at the start of my answer: political and organizational fragmentation in the face of competition from the larger emergent nation-states of Europe, as well as a political class that preferred association with the aforementioned more powerful outside forces. As an aggregate, between unification and the Renaissance the people of Italy were still materially better off than their European peers. But just as the peninsula's productive system did not innovate, neither did its political system. While the nation-states of Europe developed administrations able to scale their resources upwards, the Italian political panorama was to small and fragmented to scale in a similar manner. Thus their inability to act on the grand stage of European politics, and their destiny to follow the whims of greater powers, was sealed.