Each group of people was separated from its neighbours by tall ranges of mountains.
As a result, the people who lived in ancient Greece would not have thought of themselves so much as ‘Greeks’, but as, for example, Athenians (those who belonged to the city of Athens) or Spartans (those who belonged to the city of Sparta).
That is why we call these places 'city states'.