Thank you for the interpretative question on Psalm 7:7, “In Psalm 7:7, what is meant by “So shall the congregation of the people compass thee about: For their sakes therefore return thou on high.”
Reading the passage in the KJV is good. Reading the translator’s version of that verse may help clarify some words. I cite the broader context that may provide some additional understanding to that verse.
I looked up Psalm 7 in the Hebrew translated text from verse 4–9. The Analytical Key to the Old Testament, vol. 3 by John Joseph Owens interpret the words in the following way:
“O YAWEH my God if I have done this, if there is wrong in my hands, 5 if I have requite my friend with evil or plundered my enemy without cause, 6 let purse the enemy me and overtake and let him trample to the ground my life and my soul in the dust. Selah.
7 Arise, O YAHWEH in thy anger lift thyself up against the fury of my enemies. Awake for me a judgment thou has appointed and the assembly of the peoples let be gathered about thee and over it on high return. 8 YAHWEH judges the people. Judge me O YAHWEH, according to my righteousness and according to my integrity that is in me.”
As I look at the context, there is a contrasting conduct between the enemies of David and himself. The enemies are seeking to harm him while he has done no harm to them.
He appeals to God to be the judge between the enemies, the peoples who has come against him and to judge his own heart. To judge a person or a people group, there is a summoning of them before his throne or presence. He asks that God gathers those people to examine their hearts and to judge them according. David is confident that his hand is clean, but their hands are to harm him without a just cause. He calls on God to arise, awake to respond to his prayer for deliverance and judge his enemies.
Who are the enemies or the people who have come against David? The introduction says that this person is a Cush, a Benjamite. Thus it seems to relate to this person who was leading a group of men against David. Some scholars think that this event was when David was running from King Saul. Saul may have paid or encouraged the tribes to search and even kill David.
SUMMARY: The people who are coming to harm David is viewed as coming before the LORD God. David asks God to look into their hearts and his heart as to their motive and action. He’s asking God to look down from heaven and judge accordingly to the integrity of everyone’s heart.