Having received the revelation that Yahweh would destroy Babylon, Habakkuk could understand that He was just in using that wicked nation to discipline Israel. Babylon would not go free but would perish for her sins. Israel's punishment, on the other hand, was only temporary (cf. 2 Sam. 7:16). This insight led Habakkuk to write the prayer of praise that concludes the book.
This hymn is similar in language and imagery to Deuteronomy 33, Psalm 18:4-19, and Psalm 68. Its structure is chiastic, as indicated by the headings below.