And it is your Lord that knoweth best all beings that are in the heavens 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.
warabbuka ’a‘lamu biman fii assamaawaati wal’ardi walaqad faddalnaa ba‘da annabiyyiina ‘alaa ba‘din wa’aataynaa daawuuda zabuuran
(And thy Lord is best aware of all who are in the heavens and the earth) of the believers and what is best for them. (And we preferred some of the Prophets above others) through bestowing upon some Our friendship and speaking directly to others, (and unto David We gave the Psalms) and We gave Moses the Torah, Jesus the Gospel and Muhammad (pbuh) the Qur'an.