There are only two families in this story, the Earnshaws and the Lintons. The Earnshaws had two children, Hindley and Catherine, and they took in Heathcliff, a homeless waif. The Lintons had two children, Isabella and Edgar. Edgar married Catherine and Isabella married Heathcliff. Hindley married and had a child named Hareton. Therefore, Hareton was a nephew of BOTH Edgar and Heathcliff. It helps if you draw this out and see the family tree.
After Hindley's wife dies, he becomes a hopeless drunk and gambler. By the time he dies he has mortgaged his home to pay off his gambling debts. The mortgagee is Heathcliff. Hareton has been living with his father during this period of time, and Heathcliff has become a role model for him. What Hareton doesn't realize is that Heathcliff is using him to get revenge on Edgar and Hindley, especially Hindley for keeping him in a lower status when they were growing up. That was the reason Catherine could not marry Heathcliff, even though she loved him. He did not have the social status or education to keep her in the style to which she had become accustom. When Hareton's father dies, Heathcliff becomes Hareton's guardian. Edgar makes a weak attempt at getting guardianship, but Heathcliff refutes it.
"....Hareton, who should now be the first gentleman in the neighbourhood, was reduced to a state of complete dependence on his father's inveterate enemy and lives in his own house as a servant, deprived of the advantage of wages and quite unable to right himself, because of his friendlessness, and his ignorance that he has been wronged." (pg 182)
Heathcliff raises Hareton to be crude and coarse and then mocks him for it. He takes great pride in making him a brute.
"And he'll never be able to emerge from his bathos of coarseness and ignorance. I've got him faster than his scoundrel of a father secured me and lower; for he takes a pride in his brutishness. I've taught him him to scorn everything extra-animal as silly and weak." (pg 211)
It isn't until Heathcliff forces Cathy to marry Linton, and Linton's subsequent death, that Hareton sees how coarse and uneducated he has become. Cathy makes fun of him for his lack of education, and he admires her so much. After Edgar dies, Cathy takes pity on Hareton and teaches him to read. They form a strong friendship that eventually leads to a showdown with Heathcliff when they plant flowers outside. Cathy accuses Heathcliff of taking her land and money, and then accuses him of taking Hareton's as well.
"And Hareton's land and his money....Hareton and I are friends now, and I shall tell him all about you!" (pg 303)
After this argument, Heathcliff's insanity quickly leads to his death. Ironically, after all Heathcliff's planning to take the property and children away from both families, Hareton and Cathy marry --inherit Heathcliff's wealth and bring both properties and families together again.
He was puzzled about Hareton Earnshaw's status in the family because he was adopted into the family and then was reduced to the status of a servant.