And the Philistines left their idols there, and David and his men carried them away.
The particular service for which David was raised up was to save Israel out of the hand of the Philistines, Sa2 3:18. This therefore divine Providence, in the first place, gives him an opportunity of accomplishing. Two great victories obtained over the Philistines we have here an account of, by which David not only balanced the disgrace and retrieved the loss Israel had sustained in...
Commenting on 2 Samuel 5:17-25
And when David inquired of the Lord,.... For though he had success before, and got the victory, he would not engage again with them without having the mind and will of God, on whom he knew victory alone depended: he said, thou shalt not go up; that is, directly, and in a straight line: but fetch a compass behind them; and get to the rear...
there they left their images--probably their "lares" or household deities, which they had brought into the field to fight for them. They were burnt as ordained by law (Deu 7:5).