The answer is: “To Him ascends good speech, and righteous deeds raise it.” [Fāṭir 35:10] Whatever is not good remains bound for the earth; it does not ascend to heaven.
His statement, “Peace be upon you”: It has been said that “peace” here refers to the name of Allah, for the Prophet ﷺ said, “Indeed, Allah is al-Salām” (1), just as He says in His Book: “He is Allah—the Sovereign, the Most Holy, al-Salām.” [al-Ḥashr 59:23] According to this view, the meaning is that Allah is with the Messenger ﷺ through His protection, guardianship, care, and the like. It is as though we are saying, “Allah is watching over you”—that is, He is a vigilant Guardian, caring for you, and so forth.
It has also been said that salām is the verbal noun of sallama, meaning “to offer peace,” as Allah says: “O believers, invoke blessings upon him and greet him with full greetings of peace.” [al-Aḥzāb 33:56] Thus, offering peace upon the Messenger ﷺ means that we supplicate for his safety from every affliction.
If someone were to say: This supplication is clearly meaningful during his lifetime ﷺ, but how can we supplicate for his safety after his death, when he has died ﷺ?
The answer is that supplicating for safety is not confined to one’s lifetime. There are the terrors of the Day of Resurrection. Hence, when people cross the Bridge, the supplication of the messengers will be: “O Allah, grant safety! Grant safety!” (2) A person’s fears and afflictions do not end merely with his death.