1 Samuel 30:20
And David took all the flocks and the herds, which they drave before those other cattle, and said, This is David’s spoil. And David took all the flocks and the herds, which they drave before those other cattle, and said, This is David’s spoil.
The verse belongs to the account of David's victory over the Amalekites before he became king, a victory preceding his accession to the kingship of Judah. After the disaster at Ziklag, David encouraged himself in the Lord, sought God's direction, and pursued the Amalekites. In that pursuit David and his men recovered the captives and goods, recovering all that had been taken.
Besides the recovery, they also took the Amalekites' own flocks and herds as spoil, which were driven before the other cattle and called David's spoil. The recovery was the Lord's gift and deliverance, so the apparent disaster brought gain rather than loss. Under David's rule the spoil was shared alike between those who fought and those who had to remain behind because they were exhausted.