The events of 2 Samuel 8:1–14 are generally understood to be thematically (and not chronologically) related to the promises which God made to David in 2 Samuel 7:8–16. That is to say, many of these battles took place in history before the Lord made his promises to David.1 In terms of the narrative, however, the fulfillment of God’s promises take place immediately after they are made,2 and thereby suggests that David focused on establishing the peace that was needed for the construction of the temple.3
1 After this David defeated the Philistines and subdued them, and David took Metheg-ammah out of the hand of the Philistines.