Idhā can introduce a temporal condition or a customary occurrence. In this poetic setting, it evokes a situation that happens repeatedly. The mā following it is understood as reinforcing or pleonastic; treating it automatically as a relative pronoun would distort the construction.
Bakā is a third-person masculine singular perfect: its subject is the child from the preceding verse. Inṣarafat is a third-person feminine singular perfect: its subject is the mother. Agreement allows the reader to track the two participants.
Thus the recurring crying of the child is paired with the recurring turning of the mother; the verse describes movement, not a static portrait.