Why did Greece develop city-states?

City-states developed in Greece for a multitude of reasons. This list is not exhaustive, but mentions a few key reasons that city-states developed in Greece:

1) Minimal Land Travel:
The Greek Mainland (Thrace, Epirus, Boetia, Attica, and the Peloponnesus) is among the most mountainous and hilly land in all of Europe, making land travel between the city-state minimal. It also directed their efforts away from expanding their influence primarily over land and explains why non-coastal regions of Greece took the longest to develop.

2) Marine Travel and Naval Strength: Most of the city-states were relatively close to the water, especially those found on Crete, Cyprus, the Dodecanese Islands, or Cycladic Islands. Greek city-states favored marine travel which was more reliable and cost-effective than land travel. As a result, many city-states had strong navies as opposed to having strong armies. (Sparta is the one major exception to that rule.)

3) Chronic Disunity: Because of the prevalence of strong navies, the difficulty of land travel, and the presence of many invasion choke-points (the most famous being Thermopylae), the Greek city-states were never completely unified until Alexander the Great conquered them all. (Sparta did defeat Athens in the Peloponnesian War, but only held onto that victory for a very short time. In addition, Sparta never expanded its power into Boetia or over the Cycladic Islands - which would have been the next logical places to expand.)

4) Pastoralism and Fishing: The mountainous terrain made growing crops very difficult. The two crops that the Greeks were able to cultivate were olives and wheat, but wheat was much more difficult to maintain than the olives. This forced Greeks to resort to pastoralism (primarily animal-based agriculture) and they raised goats, sheep, and pigs. As a result, there was a lot of dairy and meat in the Greek diet relative to contemporaneous civilizations (although significantly less than today). In addition, because of the access to the sea, Greek cuisine included vast amounts of shellfish, mollusks, and proper fishes.
5) Iron Age: The common Greek people of the four branches of Greece, Doric, Aeolic, Ionian, and Attic, were no longer dependent on the kings of the Mycenaean Era who had consolidated power with their wealth and ability to possess bronze weapons. With the advent and easier accessibility of iron Greeks were able to forge weapons for themselves and were able to form states along natural geographical lines within Greece. This happened gradually and so different states had evolved differently which saw Homeric style kingdoms like Macedonia and Epirus exist with diarchies like Sparta and democracies like Athens and for a brief time Argos.