The Mediterranean Sea separated the Greek islands. These islands grew into separate city-states as they were separated by the sea.
The hills and mountains in Greece separated the individual city-states. These cities were separated by these hills and mountains, which led to them developing into different city-states.