I actually answered a similar question here although I digress into a lot of trivia and focus on a lot of minutiae, so feel free to ask for any clarification.
The short answer is that Italy continued to be the epicenter of the Mediterranean after the disappearance of the Roman Empire, which allowed the peninsula to sustain political fragmentation centered on urban centers, themselves retainers of a lot of Roman-era laws and institutions (the Roman Empire has been, at times, described as "a network of cities). These urbanocentric polities then solidified into a a half-dozen or so regional states, which then entrenched themselves, sometimes by becoming client-states of larger european nation-states after the explosion in Atlantic Trade shifted Europe's focus to the northwest.