English Basic Explanation - Chapter 12
According to Rashi, this Psalm, like many others, was composed in response to the dishonesty and duplicity from which David suffered while escaping from King Shaul. In his desperate search for supporters and sympathizers who would help protect him from the pursuing king, David came upon numerous men who presented themselves as kindhearted supporters, only to then report his whereabouts to Shaul.
David here bemoans not his personal suffering at the hands of his betrayers, but rather the sorry state of the entire nation, the absence of upright, honest, trustworthy men. The deceit he observes runs in direct contrast to the "purity" of God's word (verse 7), the divine attribute of truth that is to characterize the Jewish people. David's personal experiences have led him to the point of near despair over the moral conditions in which he lives. His only source of solace is the knowledge that God will not ignore the plight of the innocent victims of deceit and will visit retribution upon the perpetrators of evil (verses 4-6).
Towards the end of this chapter (verse 8), David petitions God to "protect them" and "guard them from this generation, forever." Rashi explains that David refers here to the young schoolchildren of his time, who, as tradition teaches, mastered even the most complex areas of Jewish law before reaching adolescence. David pleads on behalf of these pure souls that they not be tarnished by the culture of corruption and deceit that pervaded his society. The only hope for the future of ethical values in a corrupt society lay with the innocent children; David therefore prays that God save them from the clutches of his generation's depravity and allow for a new generation to arise on the foundations of truth, justice, honesty and goodwill.