I would say that this was a combination of two features: the fact that Greece is mountainous ( I think this is the major reason) so the cities were located in valleys that were not easily accessible from other valleys, and that there were many islands
These both features made communication more difficult and defense easier.