When the Philistines heard that David had been anointed king over all Israel,1 they went up in full force to search for him, but David heard about it and went out to meet them.
References for 1 Chronicles 14:8
Now the Philistines had come and raided the Valley2 of Rephaim;
References for 1 Chronicles 14:9
so David inquired of God: "Shall I go and attack the Philistines? Will you hand them over to me?" The LORD answered him, "Go, I will hand them over to you."
So David and his men went up to Baal Perazim,3 and there he defeated them. He said, "As waters break out, God has broken out against my enemies by my hand." So that place was called Baal Perazim.
References for 1 Chronicles 14:11
The Philistines had abandoned their gods there, and David gave orders to burn4 them in the fire.5
References for 1 Chronicles 14:12
Once more the Philistines raided the valley;6
References for 1 Chronicles 14:13
so David inquired of God again, and God answered him, "Do not go straight up, but circle around them and attack them in front of the balsam trees.
As soon as you hear the sound of marching in the tops of the balsam trees, move out to battle, because that will mean God has gone out in front of you to strike the Philistine army."
So David did as God commanded him, and they struck down the Philistine army, all the way from Gibeon7 to Gezer.8
References for 1 Chronicles 14:16