Answer:
Because each city-state has its culture, god to be worshiped, customs to be followed, stories to be told, and these points were built over time, generations were got in touch with it. They felt bonded with these elements because they were taught to regard them and praise them. It was part of them. It's not different from modern-day nationalism when people from a country identifies themselves because of their customs, beliefs, and cultures.
Explanation:
An example: Athens and Spart were the major cities in Ancient Greece. They had their customs. Athens built a democratic state, worship many gods, but Athena was the city god protector. It was a philosophical society, with rules and laws based on debates. The Athenians felt themselves part of these ideas, they were included in these ideas. Philosophy and art were their cultural identification. Sparta, on the other hand, was a military city, with strong people ready to battle. The Battle was their cultural identification. It was not an artistic or philosophical city.