In his effort to construct characters who represent goodness and familial love and loyalty, Charles Dickens creates many similarities between Joe Gargery, Pip's brother-in-law, and Abel Magwitch, the convict who accosts Pip in Stage 1 of the novel and ultimately becomes Pip's benefactor.
From the beginning of the novel, it is evident that Joe is the only person who truly loves Pip. Though Joe is rendered virtually powerless by his wife, Mrs. Joe, he does his best to protect Pip when Mrs. Joe is on the "ram-page." Though Joe is uneducated (he cannot read and write, and he often misuses words), he is very sensitive to others' feelings (to a fault, as he is abused by his wife, and later, by Pip) and is willing to make sacrifices to help others in need.
Abel Magwitch is the convict who threatens Pip's life in the graveyard in Chapter 1 of the novel; he is scary and abusive, and the impact this meeting has on Pip has a great (and negative) impact on the overly-sensitive protagonist. Magwitch too is uneducated, and his lack of a formal education is evident in his speech and dialect. However, Magwitch reveals himself as Pip's benefactor in Chapter 39 of the novel. He explains to Pip that he has never forgotten what Pip did for him when Pip was a child, and he vowed to work his whole life so Pip could become a gentleman.
Throughout the course of the novel, it becomes evident that Joe and Magwitch are the only people who truly care about Pip and who love Pip unconditionally. However, Pip treats both men similarly; he becomes disgusted when watch each man eat (even though Pip only has proper table manners because of Herbert's coaching), he is physically repulsed by each man's presence, and he wishes both men away whenever they are near him. In essence, Pip does not want Joe and Magwitch in his life when he believes that he is destined to be with Estella. Pip views both men as being socially inferior to him--and idea which furthers Dickens' underlying message that social class does not dictate a person's worth.
The similarities between these two characters serve to show readers that a person's character is what's important--not his or her social status.