Answer
The soldiers showed loyalty to their city-states because they believed in the values and ideals that their city-state represented and they were willing to defend it at all costs. Additionally, their sense of identity and belonging was tied to their city-state, making them willing to fight for it.