Tolstoy set up Gerasim to be a foil to Praskovya Fedorovna in these two excerpts from The Death of Ivan Ilyich by keeping her reminded that she is just a peasant. Since Praskovya does not feel anything special between her husband anymore, Gerasim has a sense of compassion by helping Ivan by being a spiritual and physical bridge.
I got that from another mender of Brainly PinkFloyd hope it helped.