Praise be to Allah, and may Allah’s peace and blessings be upon the Messenger of Allah, his family and his companions.
As to what follows:
In response to your question, we say, and with Allah Almighty lies all success:
The Barzakh is the dwelling that proceeds death until resurrection. Allah Almighty said:
“And behind them is Barzakh (a barrier) until the Day they are resurrected.” [Al-Mu’minun 23:100]
So the entire interval from after the death of a human until his resurrection is referred to as the life of the Barzakh, and this life is where the punishment of the grave and its blessings take place. As far as the rulings of this dwelling are concerned, then they differ from that of the dunya and the hereafter.
Ibn al-Qayyim says in Kitab al-Ruh, “Allah has made three dwellings: the dwelling of the dunya, the dwelling of the Barzakh and the dwelling of the permanent abode; and has made for each dwelling rulings that are specific to them. Furthermore, He has assembled this human being from a body and soul, and has made the rulings of the dwelling of the dunya to be related to the bodies, with the souls following them in that regard. As such, He has made His legislative rulings in accordance with what is apparent from the movements of the tongue and limbs, even if the souls harbor what is contrary to that. And He has made the rulings of the Barzakh to be related to the souls, with the bodies following them in that regard. So just as the souls followed the bodies in the rulings of the dunya, feeling pain as a result of their pain, feeling pleasure as a result of their relaxation, and were the ones that undertook the means of bliss and punishment; the bodies will follow the souls in their bliss and punishment, and the souls in that case are the ones that undertake the bliss and punishment. Thus, the bodies here are apparent while the souls are hidden, and the bodies are like graves for them. And the souls over there – i.e. in the life of the Barzakh – are apparent while the bodies are hidden in their graves. The rulings of the Barzakh commence on the souls, causing bliss or punishment to flow into their bodies; just as the rulings of the dunya commence on the bodies, causing bliss or punishment to flow into their souls.” [Kitab al-Ruh 1/311]
As for the souls returning back to the bodies in the graves, there are many hadiths that have proven this. Among them is the hadith of Al-Bara’ bin `Azib (may Allah be pleased with him) in describing the state in which the souls of the believer and the disbeliever exit, and what happens to them. The Messenger of Allah (peace be upon him) said in it, “So his soul is returned back into his body, and then two angels come to him and sit him up…”
This is a clear-cut statement from the Prophet (peace be upon him) concerning the soul returning back to the body. This hadith has been reported by Imam Ahmad and Abu Dawud, and all of Ahl-us-Sunnah wal-Hadith from all the various groups have chosen the opinion that is in accordance with this hadith.
Ibn al-Qayyim says in Kitab al-Ruh, “Allah, the Exalted, through His kindness, mercy and guidance, has shown us an example of that in the dunya in the state of the one who sleeps, for whatever he receives of bliss or punishment in his sleep commences primarily on his soul, with the body following it in that regard. It may even become so strong that it has an effect on the body that can be witnessed. So the one sleeping sees in his sleep that he is being beaten, then when he wakes up there are traces of the beating on his body. And he sees that he is eating and drinking, then when he wakes up he finds traces of food and drink in his mouth, and he no longer feels hunger and thirst. What is more amazing than that is that you see one who sleeps getting up while sleeping, hitting, striking and defending himself, as if he is awake, even though he is asleep not feeling any of that. That is because when the ruling was related to the soul, it sought help from the body from the outside, but if it entered it he would awaken and feel everything. Thus, if the soul feels pain and bliss, and that reaches its body by way of following it, then it is the same in the Barzakh, rather even greater; for the detachment of the soul over there is more complete and stronger, while at the same time being linked with its body, not being detached from it entirely. So on the Day the bodies will be resurrected and people will rise from their graves, the ruling, bliss and punishment becomes related to the souls and bodies in an apparent, clear and original way. Furthermore, it is when you pay attention to this point that it will become clear to you that what the Messenger (peace be upon him) has informed of concerning the punishment of the grave and its bliss, its narrowness and spaciousness, its squeezing, and it being a pit from the pits of the Fire or a garden from the gardens of Paradise; all makes sense, and that it is true without there being any doubt in it, and that whoever finds that problematic then it is due to his bad comprehension and little knowledge that he has been given.” [Kitab al-Ruh 1/311-312]