11 Then King Hiram of Tyre sent messengers to David, along with cedar timber and carpenters and stonemasons, and they built David a palace. 12 And David realized that the Lord had confirmed him as king over Israel and had blessed his kingdom for the sake of his people Israel.
13 After moving from Hebron to Jerusalem, David married more concubines and wives, and they had more sons and daughters. 14 These are the names of David's sons who were born in Jerusalem: Shammua, Shobab, Nathan, Solomon, 15 Ibhar, Elishua, Nepheg, Japhia, 16 Elishama, Eliada, and Eliphelet.
17 When the Philistines heard that David had been anointed king of Israel, they mobilized all their forces to capture him. But David was told they were coming, so he went into the stronghold. 18 The Philistines arrived and spread out across the valley of Rephaim. 19 So David asked the Lord, "Should I go out to fight the Philistines? Will you hand them over to me?" The Lord replied to David, "Yes, go ahead. I will certainly hand them over to you." 20 So David went to Baal-perazim and defeated the Philistines there. "The Lord did it!" David exclaimed. "He burst through my enemies like a raging flood!" So he named that place Baal-perazim (which means "the Lord who bursts through"). 21 The Philistines had abandoned their idols there, so David and his men confiscated them. 22 But after a while the Philistines returned and again spread out across the valley of Rephaim. 23 And again David asked the Lord what to do. "Do not attack them straight on," the Lord replied. "Instead, circle around behind and attack them near the poplar trees. 24 When you hear a sound like marching feet in the tops of the poplar trees, be on the alert! That will be the signal that the Lord is moving ahead of you to strike down the Philistine army." 25 So David did what the Lord commanded, and he struck down the Philistines all the way from Gibeon to Gezer.
Matthew Henry's Commentary on 2 Samuel 5:11-25
Commentary on 2 Samuel 5:11-16
(Read 2 Samuel 5:11-16)
David's house was not the worse, nor the less fit to be dedicated to God, for being built by the sons of the stranger. It is prophesied of the gospel church, The sons of strangers shall build up thy walls, and their kings shall minister unto thee, Isaiah 60:10. David's government was rooted and built up. David was established king; so is the Son of David, and all who, through him, are made to our God kings and priests. Never had the nation of Israel appeared so great as it began now to be. Many have the favour and love of God, yet do not perceive it, and so want the comfort of it; but to be exalted to that, and to perceive it, is happiness. David owned it was for his people's sake God had done great things for him; that he might be a blessing to them, and that they might be happy under him.
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.