Religion doesn't come up often in The Death of Ivan Ilych, but it's always in the background. Tolstoy wrote the story after his own conversion (to a more radical form of Christianity) convinced him that only a religious outlook could provide meaning to life. Ivan Ilych's life seems to illustrate this belief. Though Ivan Ilych is not a religious man for most of his life, as he nears death he begins to think more and more about judgment and demands from God a reason for his suffering. Many read Ivan's transformative last moments as a conversion experience or an encounter with God. On the other hand, Tolstoy's few depictions of organized religion in the story can hardly be called flattering. (Check out "What's Up with the Ending?" for more of our thoughts on Ivan's last moments.)
Ivan's relationship to religion appears to come out of nowhere. He shifts abruptly from believing his suffering has no purpose to believing it is a punishment from God.
God is wholly responsible for Ivan's transformation at the end of The Death of Ivan Ilych. Ivan has no role in the process.