What is a city-state? There are no city-states left in Greece to use as an example. We have to look into the past to find some.
After the Greek dark ages, villages started to band together, in part for protection and in part for more organized trade. They wanted strong trading centers. Groups of villages that banded together were called city-states. There were hundreds of city-states in ancient Greece, some really small ones and some really big ones with large populations.
Although each city-state had its own form of government and its own army, and even sometimes its own navy, and each city-state certainly its own way of doing things, the city-states of ancient Greece had many things in common. They all spoke the same language; they all believed in the same gods; they all worshiped in the same way; they all thought of themselves as Greeks. But they were loyal to their city-state. If you asked someone in ancient Greece where they were from, they would not say they were from Greece, because Greece at that time was not a country. It was a collection of city-states, each with its own personality and way of doing things. They would say they were from Athens, or Sparta, or Corinth, or Argos. The Greeks were very proud of their own city-state.
The city-states banded together to fight outsiders. They also banded together to fight each other.