It is important to realise what Gerasim represents and how his character contrasts dramatically with Ivan's wife and family and their response to his death. Gerasim is a Russian peasant whom becomes more and more important to Ivan as his death draws near. He is compassionate and giving and cares for Ivan as Ivan becomes increasingly unable to care for himself. Gerasim is one of the few characters in this story who accepts the reality of death and does not treat it as a social inconvenience that must be ignored. Note how important Gerasim becomes to Ivan:
After that Ivan Ilyich would sometimes call Gerasim and get him to hold his legs on his shoulders, and he liked talking to him. Gerasim did it all easily, willingly, simply, and with a good nature that touched Ivan Ilyich. Health, strength, and vitality in other people were offensive to him, but Gerasim's strength and vitality did not mortify but soothed him.
Gerasim therfore becomes a friend to Ivan Ilyich because of the way in which he treats him not as a burden or as an inconvenience, but a necessary part of society to be valued. Gerasim also accepts the reality of Ivan Ilyich's death, and does not pretend that he is merely sick and will get better soon.