All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The souls of the dead sometimes remember those who are still alive, whether they are their relatives or otherwise. This is supported by the Hadeeth, on the authority of Abu Hurayrah where the Prophet, sallallaahu ‘alayhi wa sallam (may Allah exalt his mention), explained the way in which the soul of the believer is taken. He mentioned that the angels take it to the souls of other believers who died before him and they express their great delight upon seeing that soul and ask it about specific people that they used to know. They also ask how they are faring with the hardships of the worldly life. [Al-Haakim and An-Nasaa’i] [Al-Albaani: Saheeh (Authentic)] It is clear from this Hadeeth that the dead can remember those they used to know in life and that they can also remember the strains and hardships of life.
In another Hadeeth on the authority of Ibn ‘Abbaas and his father, the Prophet, sallallaahu ‘alayhi wa sallam, mentioned that the souls of the martyrs of the Battle of Uhud roam freely in Paradise and that when they witness the great bliss of Paradise they ask their Lord to convey their great happiness to their brothers in the worldly life so that they would not give up Jihaad. [Abu Daawood, Al-Haakim and Ahmad] [Al-Albaani: Saheeh (Authentic)] This indicates that they remember their Muslim brothers and wish them well, and hence they want them to know how blessed they are in order to encourage them to work hard to attain Paradise.
This is the case with the souls of the believers. Other souls are too preoccupied with the torment that is inflicted upon them to exchange visits with other souls as mentioned by Ibn Al-Qayyim .
However, this does not mean that the dead know everything about the living because they lack the power to do so unless Allaah The Almighty wills. Moreover, the previously-mentioned Hadeeth indicates that the dead learn things about the living through asking the souls of those who die after them. This means that they are not aware of what is happening in life.
Allaah Knows best.