Saul was about to die. David was in a really difficult position because he was required to go to battle against his own people. He was there because he didn't trust in God's protection and stay in the Land God had promised. And, we are meant to see that David could not have known that Saul was about to die ... it was revealed to Saul, far away at night.
Despite David's foolishness in being in this position, God arranged it that the other Philistine commanders should cause David to be sent away so he didn't have to fight against God's people. Wow! ... God was at work protecting David and keeping him from the disastrous consequences of a foolish decision. With what praise must David have been travelling back to Ziklag, where he was living amongst the Philistines!
But, just as they arrived back at Ziklag he found disaster ... the Amalekites had taken Ziklag and burnt it, taking all David and his men's possessions, their wives and children - everything. It looked like total disaster! They wept until they were exhausted with weeping.
David did the right thing - he enquired of the Lord. And God told him to pursue after the Amalekites.
Well a lot of things happened, including finding a slave who the Amalekites just happened (!!) to leave behind who could tell them where they had gone. So, David and his men came upon the Amalekites and not only took back their wives and children and all the things that had been taken from them, but also destroyed the Amalekites and took all the other plunder that the Amalekites had taken from many places.
Now, disaster turned into triumph. But it was a triumph far, far greater than they even then could understand.
You see, David didn't know, but in 1 Sam 28 Saul had been told that he had failed by not destroying the Amalekites ... but David unwittingly did all that Saul hadn't done during this attack - the Amalekites were destroyed!
David didn't know that Saul had fallen in battle, but in defeating the Amalekites David was able to take the plunder the Amalekites had taken from Judah back to the people of Judah. Now, as it happened, they were just about to start looking for the next King! David didn't know it, but God was paving the way for David to find even greater favour in their eyes and be made King.
And David didn't know it, but God wanted him and his men to move from Ziklag back to God's promised land so he could become King ... and in the Philistine attack their homes in Ziklag had been destroyed, but God had now given them riches enough to re-establish back in Israel!
So, in the apparent disaster upon disaster that came from decisions that David shouldn't have made, God did far, far more than David could imagine or even see in the circumstances he was in.
David still had many tough years before he became King of Israel and defeated all the enemies. But, in all the disaster of Ziklag, God was mightily at work and was preparing for the fulfilment of His promises to David and His Kingdom purposes for Israel and for our Salvation!
We need to know this in our disasters - God has far, far greater plans for us than we can possibly imagine! Our present disasters are only a part of His greater triumphs, and He is still working things out, even in the disasters, in much greater ways than we could ever work out for ourselves.
How we need to see His greatness, trust in His sovereignty, rest in His purposes - even [particularly!] in the darkest times of our life.