Often, Rasulullah (sallallahu ‘alaihi wasallam) would get delayed (due to remaining with the deceased before his demise, and after his demise, until his burial). That is why we decided to only notify him after the actual death.
This routine continued for a few days. We would inform Rasulullah (sallallahu ‘alaihi wasallam) after the death occurred, and he would come, perform the janaazah salaah and make dua and istighfaar for the deceased. Sometimes, Rasulullah (sallallahu ‘alaihi wasallam) would participate in the burial as well, while at other times, he would return immediately after the janaazah salaah.
Thereafter, out of further consideration for Rasulullah’s (sallallahu ‘alaihi wasallam) ease, we decided to take the mayyit (deceased) directly to the home of Rasulullah (sallallahu ‘alaihi wasallam). Rasulullah (sallallahu ‘alaihi wasallam) would then perform the janaazah salaah there, in the vicinity of his home. It is for this reason that this area, where Rasulullah (sallallahu ‘alaihi wasallam) would perform the janaazah salaah, came to be known as “Mawdi’ul Janaa’iz (the place of janaazah).”
(Extracted from Seeratul Mustafa 1/434)