Both Holden and Ivan Ilyich must find a way of dealing with the fact that people do not behave as they ought. People are dishonest, and they treat other people poorly. For both of them, it is the presence of death that forces them to look at these things.
Dishonesty. Both characters come up a name for when people do not tell the truth about themselves, life, and death. Holden calls it "phoniness" and reviles it mostly in other people. (Though Holden tells us that he too is a liar, about some things he is more honest than most people.) Ivan Ilyich calls it "not the real thing," and he has to confront it mostly in himself:
It occurred to him that what had seemed utterly inconceivable before—that he had not lived the kind of life he should have—might in fact be true. ... His official duties, his manner of life, his family, the values adhered to by people in society and in his profession—all these might not have been the real thing.
Treating others poorly. One main reason people are dishonest is to cover up their own selfishness and their bad treatment of others.
Holden is very sensitive to anyone being treated in a dehumanizing manner: a principal humiliating a teacher, boys excluding another boy from a fraternity, men objectifying women, bullying. For all his faults, Holden cannot bring himself to dehumanize others.
Ivan Ilyich, on the other hand, has spent his life dehumanizing other people. As a magistrate, he enjoyed knowing that he held absolute power over everyone. He and his wife were social climbers who excluded poorer relatives from their home. Even within his home, he saw as an inconvenience his wife' emotional needs caused by pregnancy and miscarriages, and he dealt with her neediness by spending as much time as possible away from home and by cultivating distance within their marriage. So when Ivan Ilyich finally realizes the problem of man's inhumanity to man, he finds it primarily in himself and the thing he has to do is repent.
Death. For both characters, it is the looming reality of death that makes them aware of the dishonesty and inhumanity in the world. This is easier to see with Ivan Ilyich. He goes through life usually getting his way, untouched by tragedy. (Two of his children die, but to his hard heart, this more irritates than shakes him.) It is not until it becomes obvious that his illness is not going away, and that he is going to die, that Ivan Ilyich begins to think seriously about his life. Before his illness, he did not really believe that he, personally, would ever die. He has to face this first, then he has to face that his life has not been what it should be.
Holden has already been touched by death before his story begins. He lost his beloved brother Allie and was so devastated that he had a breakdown. He has also witnessed the death of James Castle, the boy who was bullied to death in Holden's old school. So Holden steps on stage knowing very well that he will die. For Holden, death is linked to the basic injustice in the world. It is the endpoint of people not treating each other with humanity. Although Holden feels suicidal, he does not commit suicide. His stated reason is that he doesn't want people to see him splattered on the sidewalk (death = indignity), but there are hints that he also refrains because he knows how much his death would hurt the people he loves, especially his sister Phoebe.
The link between death and a serious moral examination of life is much more clear and explicit in The Death of Ivan Ilyich, but it is definitely present in Catcher in the Rye as well.