Then the earth shook and trembled; the foundations of heaven moved and shook, because he was wroth.
This line comes from the song David composed while Saul was hunting him to take his life. That song reviews the dangers that surrounded him and the deliverances that rescued him. It gives praise to God as his merciful preserver. The shaking and trembling of the earth and the moving of the foundations of heaven display God's power put forth for David when he called upon Him in distress. God heard him, and the upheaval expressed His wrath against the danger that faced David.
The verse belongs to David's triumphant song of praise and thanksgiving, which ascribes every victory to God's goodness and power. In Samuel the psalm is given in its historical setting as thanksgiving for deliverance from Saul. The song is also found as Psalm 18, which it strongly resembles and parallels. Its wording differs in places between Samuel and Psalm 18. It was composed before David's great sin but after his victory over Saul and his establishment in the kingdom. The verse is cited as part of the record of David's later history, which shows the judgments that followed his great transgression and fulfilled Nathan's prophetic denunciation. The word rendered earth denotes the physical globe, and the verb rendered shook or trembled means to tremble, rustle, or quake. The verse therefore describes the physical earth shaking and trembling in an earthquake because of God's wrath, showing that terrestrial convulsions are acts of divine agency. When the Lord hears a cry from His temple and is wroth, His anger is accompanied by the shaking of the earth and the foundations of heaven. The verse is evidence that God's temple is in heaven. It is evidence that God's temple is the place from which He hears and acts. David is a type of Christ and his kingdom is a type of Christ's kingdom, especially in the subduing of enemies. The shaking of the earth because of God's wrath shows a just war undertaken by the direction of the Lord against the Lord's enemies and for the Lord's glory. The verse is recorded not for exulting in David's victories over earthly foes but for rejoicing in the victory of Christ for us and in us over all sin and spiritual foes, which the song predicts.