Thanks to a passage I was reading in Cyril of Alexandria's commentary on Isaiah, I noticed the following connection. Within Isaiah's pronouncement of judgment on Babylon we find the following:
Their children also shall be dashed to pieces before their eyes; their houses shall be spoiled, and their wives ravished. Behold, I will stir up the Medes against them, which shall not regard silver; and as for gold, they shall not delight in it. Their bows also shall dash the young men to pieces; and they shall have no pity on the fruit of the womb; their eye shall not spare children. And Babylon, the glory of kingdoms, the beauty of the Chaldees' excellency, shall be as when God overthrew Sodom and Gomorrah.
This prophecy was remembered in psalm during the captivity.
O daughter of Babylon, who art to be destroyed; happy shall he be, that rewardeth thee as thou hast served us. Happy shall he be, that taketh and dasheth thy little ones against the stones.
It is a very violent judgment - a shocking judgment to modern sensitivities. God declared that he would bring, as part of his just judgment the death of the young children of Babylon: children who were not personally involved in the destruction of Israel or its persecution. Isaiah's prophecy was fulfilled and Psalm 137 came to pass. In this way, God visited the sins of the fathers upon the children - even though the Babylonians themselves were carrying out God's chastisement on the Israelites. And in all of this, God is just and his judgments are righteous.
We ought to learn from this to fear the Lord and to serve Him only, for God is a Jealous God, visiting the iniquities of the fathers upon the children to the third and fourth generations (to them that hate Him). And in our fear we ought also to seek mercy, for God also shows mercy to thousands (of generations) to those that love Him.