This psalm contains lamentation (79:1-5), imprecation (or curses) (79:6-7, 10b, 12), pleas for mercy (79:8-10a, 11), and thanksgiving and praise (79:13).
The events of 587 BC were devastating to Jerusalem. Abraham was promised the land of Canaan and they were ripped off of it and taken into captivity.
David was promised a king from his line to sit upon his throne and this king was removed.
Solomon built the temple and the temple was destroyed.
The Psalm is very similar to Psalms 44, 74, and 137.
There is no darker time than this in the OT for God's people. However, remarkably the Psalm will end in praise.
Jesus fulfills these words as we will point out at the end.