QUESTION - Does the shaytaan know what crosses our minds of ideas which no one knows except Allah and thus whisper to us what is in accordance with our thoughts, or what?.
Praise be to Allaah.
The sound evidence indicates that the shaytaan is close to man, and indeed he flows through him like blood, so he whispers to him at moments of heedlessness and withdraws from him when he remembers Allah. Through this constant closeness he knows what whims and desires occur to man, so he makes them appear attractive to him and he whispers to him regarding them.
Al-Bukhaari (3281) and Muslim (2175) narrated from Safiyyah bint Huyayy (may Allah be pleased with her) that the Prophet (blessings and peace of Allah be upon him) said: “The shaytaan flows through man like blood.”
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: They smell a good smell or a bad smell [meaning the angels, who smell a good smell when a person is thinking of a good deed, as was narrated from Sufyaan ibn ‘Uyaynah]. But the devils do not need that [smell] in order to know; rather they even know what is in the heart of the son of Adam, and they see and hear what he says to himself. Moreover, the devil has full control over man’s heart, then when man remembers Allah he withdraws, and when he neglects to remember Him, he whispers to him. He knows whether he is remembering Allah or is neglecting to remember Him, and he knows the whims and desires of his heart and makes them appear attractive to him.
It is proven in al-Saheeh, in the hadeeth mentioned by Safiyyah (may Allah be pleased with her) that the Prophet (blessings and peace of Allah be upon him) said: “The Shaytaan flows through the sons of Adam like blood.”
The closeness of the angels and the shaytaan to the heart of the son of Adam is something that is confirmed in many reports, whether the person is a believer or a disbeliever.
End quote from Majmoo’ al-Fataawa, 5/508
The shaytaan is aware of what a person is thinking to himself, and he knows his inclinations and his whims and desires, both good and bad, so he whispers to him accordingly.
Shaykh Ibn Baaz (may Allah have mercy upon him) was asked -- in a lengthy question --: If I intend in my heart to do something good, does the shaytaan know and try to divert me from it?
He replied: Every person has a devil and an angel with him, as the Prophet (blessings and peace of Allah be upon him) said: “There is no one who does not have a companion from among the jinn and a companion from among the angels.” They said: Even you, O Messenger of Allah? He said: “Even me, but Allaah helped me with him and he became Muslim (or: and I am safe from him), so he only enjoins me to do that which is good.” And he (blessings and peace of Allah be upon him) told us that the shaytaan dictates evils to man and calls him to evil, and he has some control over his heart. And he can see, by Allah's will, what a person wants and intends to do of both good and bad deeds. The angel also has some control over his heart that makes him inclined towards good and calls him to good. This control is something that Allah has enabled them to have, i.e., He has given some power to the companions from among the jinn and from among the angels; even the Prophet (blessings and peace of Allah be upon him) had a shaytaan with him who was the companion from among the jinn as mentioned in the hadeeth quoted above.
The point here is that every person has with him a companion from among the angels and a companion from among the devils. The believer suppresses his shaytaan by obeying Allah and adhering to His religion, and he humiliates his shaytaan until he becomes weak and is unable to prevent the believer from doing good or to make him fall into evil except that which Allah wills. But the sinner, through his sins and bad deeds helps his shaytaan until he becomes strong enough to help him to follow falsehood and he encourages him to do so and he becomes strong enough to keep him from doing good.
The believer has to fear Allah and strive to resist his shaytaan by obeying Allah and His Messenger, and seeking refuge with Allah from the Shaytaan. And he should be keen to support his angel to obey Allah and His Messenger and to follow the commands of Allah.
End quote from Fataawa al-Shaykh Ibn Baaz, 9/369
And Allah knows best.