Shaykh Zayd al-Madkhali explains that after death, a person benefits from ongoing charity, beneficial knowledge they left behind, and righteous children who pray for them. Even the supplications of companions continue to help them.
What are the actions that benefit a person after he has died?
On-going charity [such as] knowledge which is inherited [by others], righteous children who supplicate for him and charity which has been given by way of wealth.
As the ḥadīth has mentioned ‘When a human being dies, all of his deeds are terminated except for three types; an on-going charity, a knowledge from which others benefit from, and a righteous child who makes duʿā for him whether male or female.’ Likewise the supplication made by his companions for him will benefit him during his lifetime as well as after death.