سُبْحَانَ ٱللَّٰهِ
Holy Qur'an
Al-Qur'an
Kids Qur'an
This seems to be an allusion to the role of Muhammad as the Last Prophet (Zamakhshari, Baydawi): despite his personal inability to "determine the fate" of the people to whom he conveyed God's message, that message is destined to remain alive forever.
I.e., just as David's "book of divine wisdom" (the Psalms) had outlived the glory of his earthly kingdom, so will Muhammad's message, the Qur'an, outlive all the changing fortunes of his followers.
The reason David is singled out here is because some Jewish authorities at the time of the Prophet (ﷺ) claimed that no scripture had been revealed after Moses. So this verse refutes this claim by referring to the Psalms of David.
Not only are we not to judge other ordinary men and carp at them. We are not to set up false standards for judging the Prophets of Allah. If one was born of the unlearned Arab race, he yet was a mercy to all the worlds. If one spoke to Allah as Kalimullah or another's life began with a miracle; it does not imply superiority. It only means that Allah's wisdom is more profound than we can fathom.
The gifts with which the prophets came may themselves take different forms, according to the needs of the world and the times in which they lived, as judged by the wisdom of Allah. A striking example here given is the gift of David over others. David was given the Zabur, the Psalter or Psalms, intended to be for the worship of Allah and the celebration of Allah's praise. For the Book of Psalms, see the last part of n. 669 to iv. 163, where exactly the same words are used about David.