What is the wisdom behind Allah asking the angels about the condition of His slaves when He knows more about them than they do?
Question

                What can we learn from some texts in which it says that Allah asks His slaves, such as His asking Jibreel what they [people] are hoping for?
Praise be to Allah.Al-Bukhaari (6408) and Muslim (2689) narrated from Abu Hurayrah that the Messenger of Allah (blessings and peace of Allah be upon him) said:
“Allah, may He be blessed and exalted, has angels who travel about, with no other job but to seek out gatherings of dhikr. When they find a gathering in which Allah is remembered, they sit with them and encircle them with their wings, until they fill the space between earth and the first heaven. When they (the people) part, they (the angels) ascend to heaven and Allah, may He be glorified and exalted, asks them, although He knows best: ‘From where have you come?’ They say: ‘We have come from some of Your slaves on earth, who were glorifying You, magnifying You, proclaiming Your Oneness, praising You and asking of You.’ He says: ‘What are they asking of Me?’ They say: ‘They are asking You for Your Paradise.’ He says: ‘Have they seen My Paradise?’ They say: ‘No, O Lord.’ He says: ‘So how about if they saw My Paradise?’ They say: ‘And they are seeking Your protection.’ He says: ‘From what are they seeking My protection?’ They say: ‘From Your Fire, O Lord.’ He says: ‘Have they seen My Fire?’ They say: ‘No, O Lord.’ He says: ‘So how about if they saw My Fire?’ They say: ‘And they are asking You for forgiveness.’ He says: ‘I have forgiven them, and given them what they asked for, and granted them protection from that from which they sought My protection.’ They say: ‘Lord, among them is So and so, a sinner who was merely passing by, then he sat with them.’ He says: ‘Him too I have forgiven. They are people whose companion cannot be doomed.’”
According to a report narrated by al-Bukhaari: “[Allah] says: ‘Have they seen Me?’ They say: ‘No, by Allah, they have not seen You.’ He says: ‘So how about if they saw Me?’ They say: ‘If they saw You, they would strive harder in worshipping You, and they would strive harder in lauding and praising You, and strive harder in glorifying You.’”
Muslim (1348) narrated from ‘Aa’ishah that the Messenger of Allah (blessings and peace of Allah be upon him) said: “There is no day when Allah ransoms more people from the Fire than the day of ‘Arafah. He draws near then He boasts about them to the angels and says, ‘What do these people want?’”
According to another report: “These are My slaves who have come unkempt and dusty from from every distant pass, hoping for My mercy and fearing My punishment, when they have not seen Me, so how about if they saw Me?”
It was narrated by ‘Abd ar-Razzaaq (8830) and classed as hasan by al-Albaani in Saheeh al-Jaami‘ (1360).
Among the reasons why Allah, may He be exalted, asks His angels about the condition of His slaves, as in this and similar hadiths, are the following, and Allah knows best:

Because Allah, may He be glorified, wants to highlight His grace to them and His mercy and forgiveness, and how He meets their needs as a reward for their righteous deeds and their seeking their Lord’s bounty in a proper manner, so that people might come to know Allah, may He be exalted, by His names and attributes, and by what He bestows upon His righteous slaves.

Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said, commenting on the hadith quoted above about the virtue of standing in ‘Arafah:
Allah, may He be glorified and exalted, says: “What do these people want?” that is, what do they seek by coming to this place? Because He wants to bestow His mercy and forgiveness upon them, and to give them what they ask for.
End quote from Majmoo‘ Fataawa wa Rasaa’il al-‘Uthaymeen (23/26).

Because He wants to highlight the virtue of these obedient and righteous people, as they put their hope in Him and fear Him without having seen Him.
Because Allah, may He be exalted, wants to explain to His angels the reason why He boasts about them and honours them, as He affirms that His slaves have come unkempt and dusty, hoping for His reward and seeking His mercy. This is also explained in the words, “He says: ‘So how about if they saw Me?’…” Thus the angels attest to these people’s obedience and righteousness even though they have not seen Allah, which is in contrast to the attitude of Iblees, who was arrogant and refused to obey.

This method of establishing facts by means of questions and answers is also used with regard to the disbeliever, but in the case of the believer it serves to highlight his honour and the blessing and favour that Allah has bestowed upon him, whereas in the case of the disbeliever it serves to rebuke and humiliate him, and to establish proof against him, as it says in the hadith of Abu Hurayrah about the reckoning of the disbeliever on the Day of Resurrection: “Allah will meet His slave and will say: ‘O So and so, did I not honour you, make you a chief, give you a spouse and subjugate horses and camels to you, and give you the opportunity to be a leader?’ He will say: ‘Yes.’ He will say: ‘Did you think that you would meet Me?’ He will say: ‘No.’ He will say: T’hen I will forget you as you forgot Me’…” Narrated by Muslim (2968).

It contains an implicit answer to the question asked by the angels when they said: “Will You place upon it one who causes corruption therein and sheds blood, while we declare Your praise and sanctify You?” [al-Baqarah 2:30].

Al-Haafiz Ibn Hajar (may Allah have mercy on him) said:
This indicates that a questioner may ask his question even when he has better knowledge of the answer than the one whom he is asking, so as to demonstrate his care for the one whom he is asking, and to highlight the latter’s virtue and high status. It was said that with regard to Allah’s asking the angels about the people of dhikr [those who remember Him], that was a reference to their having asked, “Will You place upon it one who causes corruption therein and sheds blood, while we declare Your praise and sanctify You?”. It is as if it were being said to them: Look at they do of glorifying and sanctifying Allah, despite what overwhelms them of whims and desires and the whispers of the Shaytaan, and how they resist that and surpass you in glorifying and sanctifying Allah.
It was said that from this hadith it may be understood that the dhikr of the sons of Adam is more sublime and nobler than the dhikr of the angels, because the dhikr of the humans occurs despite the fact that they are preoccupied with so many issues and distractions, and because their dhikr is remembrance of Allah without having seen Him, in contrast to the angels with regard to all of that.
End quote from Fath al-Baari (11/213).
See also: ‘Umdat al-Qaari by al-‘Ayni (23/28); Daleel al-Faaliheen (7/247).
And Allah knows best.