I think the easiest way to answer this excellent question is through an analysis of the final section of this tremendous short story. Throughout the majority of this tale, Ilyich shows that he is incapable of accepting the finality and inevitability of his own death, which of course is something that parallels the insignificance and pointlessness of his own life and of those around him, most particularly his wife and colleagues. His wife in particular keeps up her rigid social demeanour in the face of her husband's death and treats it as something bordering on an annoyance or an unwelcome distraction.
However, in the final section of this story, Ilyich is able to acknowledge and accept his death, which gives him a moment of epiphany when he is able to see how he has lived his life without any compassion. When he understands this and accepts this, he is able to express his pity and love towards his wife and son, and his fear of death is eradicated in the light of this new self-understanding:
And suddenly it grew clear to him that what had been oppressing him and would not leave him was all dropping away at once from two sides, from ten sides, and from all sides. He was sorry for them, he must act so as not to hurt them: release them and free himself from these sufferings.
Recognising and accepting our own mortality is thus vital for us to understand ourselves and to look upon our lives and how we have lived them accurately. Only by doing this was Ilyich able to understand himself and show love to those around him.