Praise be to Allah.
1 – What is mentioned in the question, that the dead do not hear anything that the living say is true and is correct. Allaah says (interpretation of the meanings):
“but you cannot make hear those who are in graves” [Faatir 35:22]
“So verily, you (O Muhammad) cannot make the dead to hear” [al-Room 30:52]
2 – The belief of Ahl al-Sunnah wa’l-Jamaa’ah is that there is torment and punishment in the grave and life in al-barzakh (the interval between death and the Day of Resurrection), and there is blessing and pleasure, according to the status of the deceased. The evidence for that is the aayah (interpretation of the meaning):
“The Fire, they are exposed to it, morning and afternoon. And on the Day when the Hour will be established (it will be said to the angels): ‘Cause Fir‘awn’s (Pharaoh) people to enter the severest torment!’”[Ghaafir 40:46]
Allaah states here that the people of Pharaoh are exposed to torment morning and afternoon even though they are dead. From this aayah, the scholars affirmed that the torment of the grave is real.
Ibn Katheer said:
This aayah is the main basis of the belief of Ahl al-Sunnah in the torment of al-barzakh, as Allaah says (interpretation of the meaning):
“The Fire, they are exposed to it, morning and afternoon” [Ghaafir 40:46]. (Tafseer Ibn Katheer, 4/82)
According to the hadeeth of ‘Aa’ishah (may Allaah be pleased with her), the wife of the Prophet (peace and blessings of Allaah be upon him), the Messenger of Allaah (peace and blessings of Allaah be upon him) used to pray in his salaah (prayer), “Allaahumma inni a’oodhu bika min ‘adhaab il-qabr, wa a’oodhu bika min fitnat il-maseeh il-dajjaal, wa a’oodhu bika min fitnat il-mahyaa wa fitnat il-mamaat, Allaahumma ini a’oodhu bika min al-ma’tham wa’l-maghram (O Allaah, I seek refuge in You from the torment of the grave, I seek refuge in You from the tribulation of the Dajjaal, I seek refuge in You from the trials of life and death, O Allaah, I seek refuge in You from sin and loss).” (Narrated by al-Bukhaari, 798; Muslim, 589)
The relevant point in this hadeeth is that the Prophet (peace and blessings of Allaah be upon him) used to seek refuge with Allaah from the torment of the grave. This is one of the pieces of evidence that confirm the torment of the grave. No one disputed the torment of the grave apart from the Mu’tazilah and some other groups who are not worth paying attention to.
3 – With regard to the hadeeth which describes the Prophet (peace and blessings of Allaah be upon him) addressing the dead bodies of the mushrikeen on the day of the battle of Badr, it is to be understood that this was a unique case, where Allaah brought them back to life so that His Prophet (peace and blessings of Allaah be upon him) might rebuke them and humiliate them.
(a)It was narrated that Ibn ‘Umar (may Allaah be pleased with him) said: “The Prophet (peace and blessings of Allaah be upon him) stood over the well of Badr [into which the bodies of the mushrikeen had been thrown] and said, ‘Have you found the promise of your Lord to be true?’ Then he said, ‘They can hear what I am saying now.’” (Narrated by al-Bukhaari, 3980; Muslim, 932)
(b)It was narrated that Abu Talhah said: “ ‘Umar said, ‘O Messenger of Allaah, why are you speaking to bodies that have no souls?’ The Messenger of Allaah (peace and blessings of Allaah be upon him) said: ‘By the One in Whose hand is the soul of Muhammad, you do not hear what I am saying any better than they do.’” Qutaadah said: Allaah brought them back to life so that they could hear what he was saying, so that they might be rebuked and feel regret and shame. (Narrated by al-Bukhaari, 3976; Muslim, 2875. See Fath al-Baari, 7/304)
The relevant point here is that Allaah caused the people in the well to hear the words of His Prophet (peace and blessings of Allaah be upon him), so that they might be humiliated. But it is not correct to deduce from this hadeeth that the dead can hear everything, because this applied only to the people in the well. Some scholars made an exception and said that the dead can hear the salaam, but this is a view for which clear sound evidence is lacking.
4 – According to the most correct scholarly view, the torment of the grave befalls both the soul and the body.
Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) said:
“The view of the salaf (earliest generations) of this ummah and its imams is that the torment or blessing (of the grave) happens to the soul of the deceased and his body. After it departs from the body, the soul continues to be blessed or punished, and it is also connected to the body from time to time, so that the blessing or torment befalls the body as well as the soul.”
So we must believe in that which Allaah has told us. (al-Ikhtiyaaraat al-Fiqhiyyah, p. 94)
Ibn al-Qayyim said:
Shaykh al-Islam (Ibn Taymiyah) was asked about this matter, and we will quote his reply in full:
“Indeed, the torment and blessing happen to both the soul and the body, according to the consensus of the Ahl al-Sunnah wa’l-Jamaa’ah. The soul is blessed or tormented separately from the body, and it is blessed or tormented in connection with the body. The body is connected to it, so in this case the blessing or torment happens to them both, and it may happen to the soul separately from the body.
The view of the salaf and imams of this ummah is that when a person dies, he will be in a state of blessing or torment, and that happens to his soul and his body. After the soul has departed from the body, it remains in a state of blessing or torment, and that is sometimes connected to the body and the blessing or torment happens to them both. Then when the Day of Resurrection comes, the souls will be returned to their bodies and they will rise from their graves to meet the Lord of the Worlds. The physical resurrection is a matter upon which the Muslims, Jews and Christians are agreed.” (al-Rooh, p. 51, 52)
The scholars likened that to dreams when one is asleep, for a person may dream that he is going and traveling, and he may feel happiness or grief and sorrow while he is sleeping, and that is when he is in his place and in this world. So it is more apt that things should be different in the life of al-barzakh which is completely different from the life of this world and the life of the Hereafter.
“If it is said, we see the deceased and how he is in his grave, so how can he be questioned, made to sit up and beaten with iron rods, when no mark is left on him? The answer is that this is not impossible, and indeed there is a similar case in our regular lives, that of the sleeper who feels joy or pain of which we feel nothing. A person who is awake may also feel joy or pain because of something he hears or thinks about, and those who are sitting with him feel nothing of that. Similarly, Jibreel used to come to the Prophet (peace and blessings of Allaah be upon him) and tell him of the Wahy (Revelation), and the people present were unaware of it. All of that is clear and evident.” (Sharh Muslim, 17/201)
Shaykh al-Islam Ibn Taymiyah said:
“When a person sleeps, he may feel joy or pain, and that happens to his soul and his body. He may dream that someone is beating him and wake up with pain in his body, or he may dream that he is being fed some good food, then wake up with the food in his mouth. This is something that really happens. If the body and soul of a sleeping person can experience joy and pain that are not felt by the person next to him, and a sleeper may even cry out because of the intensity of pain or fear of what is happening to him, and those who are awake can hear him, and he may speak, reciting Qur’aan or dhikr, or talking to someone, and those who are awake can hear that, even though he is asleep with his eyes closed, and he does not hear them if they speak to him – then how can we deny that the one who is buried in his grave also feels things, when the Messenger (peace and blessings of Allaah be upon him) has told us that he “hears the sound of their footsteps” and “You do not hear what I say any better than they do”?
The heart is akin to the grave, hence the Prophet (peace and blessings of Allaah be upon him) said, when he missed ‘Asr on the day of al-Khandaq: “May Allaah fill their hearts and graves with fire.” And Allaah differentiated between them (graves and hearts) in the aayah (interpretation of the meaning):
“Knows he not that when the contents of the graves are poured forth (all mankind is resurrected)?
And that which is in the hearts (of men) shall be made known?” [al-‘Aadiyaat 100:9-10]
This is just to explain that this could happen.
And Allaah knows best