David was a man of war, because he had to be, and that makes sense, because the LORD Himself is a man of war for righteousness! As Moses sang in Exodus 15:2-4:
2. The LORD is my strength and song, And He has become my salvation; He is my God, and I will praise Him; My father's God, and I will exalt Him.
3. The LORD is a man of war; The LORD is His name.
4. Pharaoh's chariots and his army He has cast into the sea; His chosen captains also are drowned in the Red Sea.
Also remember that the LORD is the "LORD of Hosts." Albert Barnes explained that this name for the LORD God first shows up in 1 Samuel 1:3, where Samuel's father went up yearly to worship and sacrifice to the LORD of hosts in Shiloh. Barnes also explained that this title of Yahweh shows up in various forms over 260 times in the Old Testament. And the word "hosts" means "army." It's the LORD's heavenly army that includes all the multitudes of holy Angels. GotQuestions.org added that "the name 'LORD of Hosts' emphasizes God’s sovereign control over every power, dominion, force, and realm.
*This name for the LORD God also appears in Romans 9:29 where Paul quoted Isaiah 1:9 and wrote this about the idol worshipping Jews, "As Isaiah said before: 'Unless the Lord of Sabaoth had left us a seed, We would have become like Sodom, And we would have been made like Gomorrah." This name for God is also in James 5:1-4. There the Lord's half-brother condemned godless rich people, and wrote:
1. Come now, you rich, weep and howl for your miseries that are coming upon you!
2. Your riches are corrupted, and your garments are moth-eaten.
3. Your gold and silver are corroded, and their corrosion will be a witness against you and will eat your flesh like fire. You have heaped up treasure in the last days.
4. Indeed the wages of the laborers who mowed your fields, which you kept back by fraud, cry out; and the cries of the reapers have reached the ears of the LORD OF SABAOTH.
*Then in Revelation 19:11-16, we see our risen Savior Jesus Christ coming back to earth to make war. And the Apostle John wrote:
11. Now I saw heaven opened, and behold, a white horse. And He who sat on him was called Faithful and True, and in righteousness He judges and makes war.
12. His eyes were like a flame of fire, and on His head were many crowns. He had a name written that no one knew except Himself.
13. He was clothed with a robe dipped in blood, and His name is called The Word of God.
14. And the armies in heaven, clothed in fine linen, white and clean, followed Him on white horses.
15. Now out of His mouth goes a sharp sword, that with it He should strike the nations. And He Himself will rule them with a rod of iron. He Himself treads the winepress of the fierceness and wrath of Almighty God.
16. And He has on His robe and on His thigh a name written: KING OF KINGS AND LORD OF LORDS. (Praise the LORD!)
Sources:
-Adapted from ALBERT BARNES' NOTES ON THE BIBLE by Albert Barnes - Published in 1847-85 - 1 Samuel 1:3 - Downloaded to e-Sword by Rick Meyers - Copyright 2021
-GotQuestions.org - What does the Bible mean when it calls God the "LORD of hosts"? - https://www.gotquestions.org/Lord-of-hosts.html