John Gill's Exposition of the Whole Bible
Psalms 27 - Introduction
INTRODUCTION TO PSALM 27
[A Psalm] of David. The Septuagint interpreters add to this title, "before he was anointed". David was anointed three times, first when a youth in his father's house; but this psalm could not be written before that time, because he had not had then any experience of war, nor could be in any immediate apprehension of it, as here suggested; he was anointed a second time, after the death of Saul at Hebron, by the men of Judah; before that time indeed he had been harassed by Saul, and distressed by the Amalekites, and was driven from the public worship of God, to which he has a respect, Psalms 27:4; and he was a third time anointed, by the elders of Israel, king over all Israel; and between the death of Saul and this unction there was a war between the house of David and the house of Saul; but what is referred to is not certain, nor is it of moment, since these words are neither in the Hebrew text, nor in the Chaldee paraphrase. Theodoret is of opinion this psalm was written by David when he fled from Saul, and came to Ahimelech the priest.