COMMENTARY on 17:55
Mustafa Khattab:

Translation:
Your Lord knows best all those in the heavens and the earth. And We have surely favoured some prophets above others, and to David We gave the Psalms.8 
Commentary:
8   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.

 

A. Yusuf Ali:

Translation:
And it is your Lord that knoweth best all beings that are in the heavens 2240 and on earth: We did bestow on some prophets more (and other) gifts than on others: and We gave to David (the gift of) the Psalms. 2241
Commentary:

2240  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 Kalim Allah or another's life as Ruh Allah begun with a spiritual miracle; it does not imply superiority. It only means that Allah's wisdom is more profound than we can fathom. (R).

2241  The spiritual 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 song and music as given to David, but it implies no superiority of David over others. David was given the Zabur, the psalter or Psalms, intended to be sung 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 4:163, where exactly the same words are used about David.

 

Muhammad Asad:

Translation:
seeing that thy Sustainer is fully aware of [what is in the minds of] all beings that are in the heavens and on earth. But, indeed, We did endow some of the prophets more highly than others 63 -just as We bestowed upon David a book of divine wisdom [in token of Our grace] 64
Commentary:
63  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.
64  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.