David Defeats the Amalekites, 1-31

30:1 On the third day David and his men came to Ziklag. Now the Amalekites had raided the Negev and Ziklag. They attacked Ziklag and burned it. 30:2 They took captive the women who were in it, from the youngest to the oldest, but they did not kill anyone. They simply carried them off and went on their way.

Aerial view of the archaeological site at Khirbet a-Ra’i where researchers believe they have located the biblical city of Ziklag.

Ziklag – ‘After a 12-year study of the entire region, archaeologists say they may have found the biblical city of Ziklag near the southern town of Kiryat Gat in Israel. The find, dating to the early tenth century BC, is consistent with scriptural references to the geography of the area: a rural settlement dating to the time of King David among the remains of a Philistine settlement that had been destroyed by fire.’ (Source)

30:3 When David and his men came to the city, they found it burned. Their wives, sons, and daughters had been taken captive. 30:4 Then David and the men who were with him wept loudly until they could weep no more. 30:5 David’s two wives had been taken captive—Ahinoam the Jezreelite and Abigail the Carmelite, Nabal’s widow. 30:6 David was very upset, for the men were thinking of stoning him; each man grieved bitterly over his sons and daughters. But David drew strength from the LORD his God.
30:7 Then David said to the priest Abiathar son of Ahimelech, “Bring me the ephod.” So Abiathar brought the ephod to David. 30:8 David inquired of the LORD, saying, “Should I pursue this raiding band? Will I overtake them?” He said to him, “Pursue, for you will certainly overtake them and carry out a rescue!”
30:9 So David went, accompanied by his six hundred men. When he came to the Wadi Besor, those who were in the rear stayed there. 30:10 David and four hundred men continued the pursuit, but two hundred men who were too exhausted to cross the Wadi Besor stayed there.
30:11 Then they found an Egyptian in the field and brought him to David. They gave him bread to eat and water to drink. 30:12 They gave him a slice of pressed figs and two bunches of raisins to eat. This greatly refreshed him, for he had not eaten food or drunk water for three days and three nights. 30:13 David said to him, “To whom do you belong, and where are you from?” The young man said, “I am an Egyptian, the servant of an Amalekite man. My master abandoned me when I was ill for three days. 30:14 We conducted a raid on the Negev of the Kerethites, on the area of Judah, and on the Negev of Caleb. We burned Ziklag.” 30:15 David said to him, “Can you take us down to this raiding party?” He said, “Swear to me by God that you will not kill me or hand me over to my master, and I will take you down to this raiding party.”
30:16 So he took David down, and they found them spread out over the land. They were eating and drinking and enjoying themselves because of all the loot they had taken from the land of the Philistines and from the land of Judah. 30:17 But David struck them down from twilight until the following evening. None of them escaped, with the exception of four hundred young men who got away on camels. 30:18 David retrieved everything the Amalekites had taken; he also rescued his two wives. 30:19 There was nothing missing, whether small or great. He retrieved sons and daughters, the plunder, and everything else they had taken. David brought everything back. 30:20 David took all the flocks and herds

Four hundred young men who got away on camels – Long thought to be an anachronism.  Alan Millard writes:

‘For decades biblical scholars have followed the repeated assertion of W. F. Albright that camels were not domesticated in the Near East before the eleventh century BC. It is that assumption, presumably, which lies behind the assertion that camels in this passage is anachronistic, even though it is set near the end of the eleventh century.

‘All are now agreed that the camel became a means of transport across the Near East from the twelfth century BC onwards. The Assyrian king Ashur-bel-kala (c. 1074–1057 BC) boasts of his merchants acquiring camels, which he then bred and put on show with other foreign creatures. The camel was not suited to urban or riverine environments, being at home in the steppe or desert. Thus the paucity of references to camels in the Bible as in other ancient documents is
largely due to the nature of those documents, almost all of them being produced in towns for the inhabitants of towns. However, the range of written references and artistic representations show the camel was known and used across the Fertile Crescent from the Late Bronze Age onwards. Sites on the desert edges of eastern Arabia have, not surprisingly, yielded camel bones in large quantities from the third and second millennia BC. Therefore, the mention of camels in the biblical text dealing with late eleventh-century raiders, the Amalekites, from the steppe where camels were at home presents no difficulty.’

and drove them in front of the rest of the animals. People were saying, “This is David’s plunder!”
30:21 Then David approached the two hundred men who had been too exhausted to go with him, those whom they had left at the Wadi Besor. They went out to meet David and the people who were with him. When David approached the people, he asked how they were doing. 30:22 But all the evil and worthless men among those who had gone with David said, “Since they didn’t go with us, we won’t give them any of the loot we retrieved! They may take only their wives and children. Let them lead them away and be gone!”
30:23 But David said, “No! You shouldn’t do this, my brothers. Look at what the LORD has given us! He has protected us and has delivered into our hands the raiding party that came against us. 30:24 Who will listen to you in this matter? The portion of the one who went down into the battle will be the same as the portion of the one who remained with the equipment! Let their portions be the same!”

Concerning David’s allocation of the spoils of war, Baldwin comments:

‘David’s sense of justice was instructed by his experience of the mercy and generosity of his Lord, and for that reason surpassed ordinary human standards of what is just and right.’

30:25 From that time onward it was a binding ordinance for Israel, right up to the present time.
30:26 When David came to Ziklag, he sent some of the plunder to the elders of Judah who were his friends, saying, “Here’s a gift for you from the looting of the LORD’s enemies!” 30:27 The gift was for those in the following locations: for those in Bethel, Ramoth Negev, and Jattir; 30:28 for those in Aroer, Siphmoth, Eshtemoa, 30:29 and Racal; for those in the cities of the Jerahmeelites and Kenites; 30:30 for those in Hormah, Bor Ashan, Athach, 30:31 and Hebron; and for those in whatever other places David and his men had traveled.