Chapter 68—David at Ziklag This chapter is based on 1 Samuel 29 ; 30 ; 2 Samuel 1 . David and his men had not taken part in the battle between Saul and the Philistines, though they had marched with the Philistines to the field of conflict. As the two armies prepared to join battle the son of Jesse found himself in a situation of great perplexity. It was expected that he would fight for the Philistines. Should he in the engagement quit the post assigned him and retire from the field, he would not only brand himself with cowardice, but with ingratitude and treachery to Achish, who had protected him and confided in him. Such an act would cover his name with infamy, and would expose him to the wrath of enemies more to be feared than Saul. Yet he could not for a moment consent to fight against Israel. Should he do this, he would become a traitor to his country—the enemy of God and of His people. It would forever bar his way to the throne of Israel; and should Saul be slain in the engagement…
"Now the Philistines gathered together all their armies to Aphek: and the Israelites pitched by a fountain which is in Jezreel."
The EGW passage explicitly states that the chapter is based on 1 Samuel 29 and 30, and 2 Samuel 1. It then summarizes the events described in those chapters, including the Philistines gathering their armies.
"David was caused to feel that he had missed his path. Far better would it have been for him to find refuge in God's strong fortresses of the mountains than with the avowed enemies of Jehovah and His people. But the Lord in His great mercy did not punish this error of His servant by leaving him to himself in his distress and perplexity; for though David, losing his grasp on divine power, had faltered and turned aside from the path of strict integrity, it was still the purpose of his heart to be true to God. While Satan and his host were busy helping the adversaries of God and of Israel to plan against a king who had forsaken God, the angels of the Lord were working to deliver David from the peril into which he had fallen. Heavenly messengers moved upon the Philistine princes to protest against the presence of David and his force with the army in the approaching conflict. PP 690.2"
"He shall cover thee with his feathers, and under his wings shalt thou trust: his truth shall be thy shield and buckler."
The EGW passage describes God's protection of David even when David makes mistakes, while Psalm 91:4 speaks generally of God's protection. The connection is thematic, focusing on divine protection, but not a direct allusion.