Second, the Lord delivered his captive people when they cried out to Him (cf. Matthew 8:28-34; Luke 1:79; Luke 4:18-19). God had set them free. He provided freedom for those held in captivity because of their sins. This is another clue that this psalm dates from after the Babylonian captivity. Perhaps this stanza inspired Charles Wesley to write "And Can It Be That I Should Gain?"[source]
"Long my imprisoned spirit layFast bound in sin and nature"s night;Thine eye diffused a quick"ning ray,I woke, the dungeon flamed with light;My chains fell off, my heart was free,I rose, went forth, and followed Thee."[source]