John Gill's Exposition of the Whole Bible
Psalms 37 - Introduction
INTRODUCTION TO PSALM 37
[A Psalm] of David. This psalm, it is very probable, was written at the same time, and upon the same occasion, with the former; and describes the different states of good and bad men; and is full of exhortations, instructions, and advice to the people of God; intermixed with various encouraging promises. A late learned writer h thinks it was written for Mephibosheth's consolation under Ziba's calumny.
h Delaney's Life of King David, vol. 2. p. 219.