I guess this question addresses two major concerns - why did medieval Italy develop city-states instead of vast kingdoms, and then why were these city-states (somewhat) republican, while (to my knowledge) most of Europe was monarchic?
I apologize if this is a bad question due to my lack of understanding of history. I'm watching a documentary on the Renaissance right now and the fact that one region developed, to my knowledge, distinctly to every other region, interests me greatly.
I think a key element here are the Alps. Northern Italy used to be part of the Holy Roman Empire, but the Alps gave it natural protection against Holy Roman Emperors with their power base in the North. Meanwhile, the fact that Italy is a peninsula also protected the city states from the encroachment of the Ottoman Empire. So, I think geography played a role in creating a geo-political system between 3 seas and the Alps. Why countries outside the Italy were unable to overcome these geographic barriers, and why no power within the Italian peninsula was able to conquer the small principalities and city states I do not know, however.
See more here btw, asked by /u/Togsy: https://www.reddit.com/r/AskHistorians/comments/3w1zse/why_did_the_cities_in_the_holy_roman_empire_not/