"His deeds come to an end" means that he does not any longer receive the return and reward on his actions. But there are three categories of actions on which he receives reward even after his death. First, Sadaqah Jariyah such as building a mosque, or a hospital, or digging a well. As long as people will benefit from these, he will receive a reward for them. Second, "knowledge which is beneficial" means to impart knowledge to others or to propagate knowledge by means of one's books. As long as this medium of teaching will continue and his books will be studied and people will benefit from them, he will receive a reward for it. Third, virtuous descendants. Training of children on the right lines is essential so that after a person's death they continue to pray for him. The prayer of children in favour of parents is highly useful.