The psalmist returns from a vision of the glorious future to the reality of facing his enemies (Psalm 9:3).
The gates are a strong image of the powerful grip of death (see Psalm 13:3–4).
The gates of Daughter Zion (that is, Jerusalem) provide an intentional contrast to the gates of death.