18 Now the Philistines had come and spread out in the Valley of Rephaim; 19 so David inquired of the Lord, "Shall I go and attack the Philistines? Will you deliver them into my hands?" The Lord answered him, "Go, for I will surely deliver the Philistines into your hands." 20 So David went to Baal Perazim, and there he defeated them. He said, "As waters break out, the Lord has broken out against my enemies before me." So that place was called Baal Perazim.[1] 21 The Philistines abandoned their idols there, and David and his men carried them off. 22 Once more the Philistines came up and spread out in the Valley of Rephaim;

Matthew Henry's Commentary on 2 Samuel 5:18-22

Commentary on 2 Samuel 5:17-25

(Read 2 Samuel 5:17-25)

The Philistines considered not that David had the presence of God with him, which Saul had forfeited and lost. The kingdom of the Messiah, as soon as it was set up in the world, was thus attacked by the powers of darkness. The heathen raged, and the kings of the earth set themselves to oppose it; but all in vain, Acts 2:2.