Jerusalem having been acquired, David had to prepare for war with the Philistines, in which the king gave proof at once of his heroic courage and his unshakable trust in God. The latter quality he displayed signally in the battle that took place in the Valley of the Giants. God had commanded David not to attack the host of the Philistines until he heard "the sound of marching in the tops of the mulberry trees."

God desired to pass judgment upon the tutelary angels of the heathen, before surrendering the heathen themselves to the pious, and the motion of the tops of the trees was to indicate that the battle could proceed. The enemy advanced until there were but four ells between them and the Israelites. The latter were about to throw themselves against the Philistines, but David restrained them, saying: "God forbade me to attack the Philistines before the tops of the trees begin to move.

If we transgress God's command, we shall certainly die. If we delay, it is probable that we shall be killed by the Philistines, but, at least, we shall die as pious men that keep God's command. Above all, let us have confidence in God." Scarcely had he ended his speech when the tops of the trees rustled, and David made a successful assault upon the Philistines.

Whereupon God said to the angels, who were constantly questioning him as to why he had taken the royal dignity from Saul and given it to David: "See the difference between Saul and David."