Abel Magwitch returns to London because he wants to see how Pip is doing and if he is a gentleman.
You are correct that the convict that scared Pip in the beginning of the book was indeed his benefactor, not Miss Havisham. Magwitch was so impressed by Pip’s charity and kindness in giving him food and coming back even though he was scared that he decided to look after Pip when he made his fortune in Australia. Magwitch also wanted to prove that anyone, even a poor blacksmith’s nephew, could become a gentleman.
“And this,” said he, dandling my hands up and down in his, as he puffed at his pipe:” and this is the gentleman what I made! The real genuine One! It does me good fur to look at you, Pip. All I stip'late, is, to stand by and look at you, dear boy!” (ch 40, p. 233)
Magwitch risks his life to come back and see Pip because he wants to know what has become of him. He also wants to see if he has become a gentleman. It is Magwitch’s revenge on society for treating him so badly. Compeyson got off easily when they were tried together, but Magwitch was sent to Australia and banned from England because he did not have the manners and dress that Compeyson did. Magwitch is impressed that Pip seems very gentleman-like, and the two eventually grow to have genuine affection for one another.