It is interesting to come at this question by looking at the structure that the book takes. In The Death of Ivan Ilyich, Tolstoy reverses traditional chronological narrative, starting in the aftermath of Ivan's death before jumping backwards to tell us about Ivan's life. As a reader, we could be forgiven for thinking that the book is going to be about Ivan's death—but, in fact, it is the reverse.
The opening of the novel is one of the clearest demonstrations of the artifice of life among bourgeois society. We start off in the law courts of St Petersburg when Ivan's colleagues hear of his death. The news is not broken to them in person; they learn it from a newspaper. Only Peter attends the wake, and this is out of a sense of obligation. We encounter Ivan's widow in theatrical tears, and she proceeds to ask how she can get the most out of Ivan's pension.
In the course of Ivan's life, everything is pleasant and everything is decorous. Ivan trains as a lawyer, marries, and has children, living a perfectly ordinary and therefore, according to Tolstoy, "perfectly terrible" existence. The reason Ivan's existence is at the same time pleasant and terrible is due to its shallowness and materialism. It is only in the face of his mortality that Ivan begins to reflect upon his life.
During his illness, Ivan becomes obsessed with the notion of death, while his family merely act as though he is just sick and will get better. It is only Gerasim who acknowledges the inevitability of Ivan's death, and this simple acknowledgement is a huge comfort.
It is through the contrast of Ivan's shallow, material life and Gerasim's calm acceptance of human mortality that Tolstoy examines the dichotomy of artifice and authenticity. We can conclude that this novel is not, as the title suggests, about Ivan Ilyich's death but is in fact an examination of his life. It is only when Ivan's life is held up against the profundity of death that Ivan realizes how empty and false it was. Gerasim serves as an exemplary character, living an authentic existence away from the false pleasantness of the bourgeoisie with the full spiritual awareness of human mortality.
The fact that the book is structured in reverse adds emphasis to Ivan's conclusion that his life was "not the real thing," as the novel is really about the ultimate realization that a good life is one lived in honesty and authenticity; one can only achieve a good death through living a good life.