What sort of conditions (social, environmental, demographic, cultural and so on) lead to city-states forming in an area. Why do they tend to form rather than territorial states and other forms of organization? Why did places like Classical Greece, Renaissance Italy and the East African coast develop clusters of city-states when other places like China and Northern Europe did not?
I can speak on Ancient Greece. Looking at the geography of Ancient Greece, what is immediately apparent is the high number of islands, whose terrestrial feature is independence from other landmasses. In the scope of looking at similar civilizations such as Japan, whose independence from Mongolia was guaranteed because of geographical distance from the mainland, Greek city states were also able to combat forces of foreign domination. I think that therefore, cultural conditions in Greece, in fact, led to the formation of leagues—the Peloponnesian or the Delian, whose construction is, in fact, different—hegemonic and defensive, respectively, at the time of their formation. Now looking at the leaders of the separate leagues, Sparta and Athens, the two largest poleis (plural of polis, "city-state"), they inhabited two different environments within the Greek peninsula. Firstly, Sparta, dominating city-state of the Peloponnesian peninsula, was in the dominating position on the Eurotas river, on the Helos plain (the origin of the term "Helot", the slave population of Sparta (ask me about Sparta as I've just spent the past winter and spring studying it)), and was able to control quite easily large part of the surrounding landscape, and past the Taygetus mountains, into Messenia. Sparta, therefore, was the largest polis, occupying nearly 16,000km^2 of territory (in comparison the average polis was 250km^2). They therefore developed a military and strategy reflective of their power base: plains.
On the other hand, Athens was known as a thalassocracy, a city-state which dominated the sea, because you guessed it, they had a possibility of dominating the sea. They first were able to dominate the sea through trade, exporting olive oil, which was able to grow in the foothills of Attica (the deme of Athens) and trade it for grain, specifically grain grown in Egypt and past the Hellespont, in modern-day Ukraine, Romania, etc.
Thirdly, there is a very important point on the character of the Greek. They were competitive. Their society fetishized honor like American society does cheeseburgers. The Persian general Tigranes famously exclaimed, "Good heavens! Mardonius, what kind of men are these against whom you have brought us to fight? Men who do not compete for possessions, but for virtue" [Herodotus The Histories 8.26]. This was not just man vs. man, it was polis vs. polis, and it was unending and evident that this had an enormous effect on intra-polis strife. All of them wanted to be better than the other, and being submitted by another polis made sure that only in the cases of the hegemonic Spartan Peloponnesian League was there the widespread
What created the Greek city state? Geography, personality, and economy.