1 Samuel 30:1

And it came to pass, when David and his men were come to Ziklag on the third day, that the Amalekites had invaded the south, and Ziklag, and smitten Ziklag, and burned it with fire;

On the third day David and his men came back toward Ziklag from the Philistine army to find the city struck in their absence, for the Amalekites had taken advantage of their being away to invade the south and Ziklag and burn it with fire. The raiders had invaded and burned the city and had carried away its women and children captive. They sacked and burned the place and carried its inhabitants and much spoil away, including David's wives and children, the wives and children and families of his men, and the women and children of the place, with the loss of city, families, and goods.

Their ability to do this shows that Amalekites had survived Saul's campaign and afterward had grown numerous and strong enough to capture Ziklag. Saul's destruction of "all" meant all those in the cities and nearby places where he fought, not every Amalekite everywhere. The Amalekites still existed after Israel's earlier conflicts with them, as seen in their invasion of the south and burning of Ziklag.

David afterward defeated the Amalekites for this raid before he became king of Judah, one of the occasions on which he defeated them. Their continued existence at this time and their eventual disappearance fulfilled the prediction that their name would be blotted out.

The loss cut David off from every human support, with Saul having driven him from his country, the Philistines having driven him from the camp, his city plundered, his loved ones made prisoners, and even his own familiar friends and men turning upon him as the cause of their calamities and threatening him with death. He and his strong warriors wept until they had no more power to weep. In that strait he reviewed his past life, saw his mistake, encouraged himself in the Lord, inquired of the Lord through the priest, was heard, and received a renewed promise of deliverance.

The burning of Ziklag with loss of city, families, and goods was a terrible seeming misfortune permitted to meet God's servants while they were in the path of duty, yet it ultimately led to recovery and gain rather than loss.