Answer:
Many psalms that begin with complaint and prayer end with joy and praise, but this begins with joy and praise and ends with sad complaints and petitions; for the psalmist first recounts God's former favours, and then with the consideration of them aggravates the present grievances. It is uncertain when it was penned; only, in general, that it was at a time when the house of David was woefully eclipsed; some think it was at the time of the captivity of Babylon, when king Zedekiah was insulted over, and abused, by Nebuchadnezzar, and then they make the title to signify no more than that the psalm was set to the tune of a song of Ethan the son of Zerah, called Maschil; others suppose it to be penned by Ethan, who is mentioned in the story of Solomon, who, outliving that glorious prince, thus lamented the great disgrace done to the house of David in the next reign by the revolt of the ten tribes.
(1).God made a covenant with is servants David
Explanation: hope this could help you