Gerasim is able to connect with his master precisely because of his simple peasant background and the way that he honestly accepts death as part of the process of life. Note what he says in the first chapter of this story in response to an inquiry about his master's death:
"It is God's will. We shall all come to it some day."
It is because of this acceptance and recognition of death that he is able to connect with Ivan Ilyich and this distinguishes him from Ivan Ilyich's family, who persist in holding on to the "lie" that abhors Ivan Illyich so much:
What tormented Ivan Ilyich most was the deception, the lie, which for some reason they all accepted, that he was not dying but was simply ill, and that he only need keep quiet and undergo a treatment and then something very good would result.
In contrast, Gerasim's simple acknowledgement that Ivan Ilyich is dying and that he is happy to help a dying man shows his sympathy and his desire to empathise with Ivan Ilyich's position:
He saw that no one felt for him, because no one even wished to grasp his position. Only Gerasim recognised it and pitied him. And so Ivan Ilyich felt at ease only with him.
Death is therefore shown through the character of Gerasim to not be an unpleasant inconvenience that must be ignored as much as possible but a natural process. Gerasim thus stands as a harsh criticism about the civilised life that offers only despair to Ivan Ilyich up until a few moments before his death.