Magwitch meets Pip at the beginning of the novel in the graveyard when Magwitch is in dire straits and sorely in need of help. Pip generously gives him the help he needs--partly out of terror, partly out of compassion. The parts combined so that Magwitch's life is changed by his encounter with Pip. Then he chooses a more noble path in life than that of crime after which he becomes Pip's secret benefactor as a way to repay his gratitude.
The themes of crime and punishment and justice naturally arise around Magwitch since he is an escaped criminal when Pip first encounters him in the opening of the novel and is called to account for his crimes in the end of the novel.
"You have a returned Transport there," said the man who held the lines. "That's the man, wrapped in the cloak. His name is Abel Magwitch, otherwise Provis. I apprehend that man, and call upon him to surrender, and you to assist."
Pip sees how crime and punishment works in what Dickens portrays as a corrupt justice system. Pip also sees the injustice one person can express toward another when he comes to value Magwitch differently than he did before.
"I will never stir from your side," said I, "when I am suffered to be near you. Please God, I will be as true to you as you have been to me!"
Estella really speaks for Magwitch's transformation, Pip's revelation, and her own transformation when she says, "I am greatly changed. I wonder you know me."