For the leader, by David: The despicable person has said in his heart, “There is no G-d”; they have dealt corruptly; they have acted abominably; none of them does good.
The commentators see in this Psalm a prophecy of Nebuchadnezzar, who destroyed the Temple. The Metzudas David explains that Nebuchadnezzar acted as he did because he did not believe that G-d exists. The plural “they” in the second part refers to Nebuchadnezzar, plus the nation that followed him. The Psalm speaks in the past tense because in his vision, David saw future events as though they had already happened.