In chapter 22, Herbert Pocket tells Pip Estella’s story. He’s a relative, so he has the inside scoop.
He tells Pip:
“I don't say no to that, but I meant Estella. That girl's hard and haughty and capricious to the last degree, and has been brought up by Miss Havisham to wreak revenge on all the male sex.”
This is the first time Pip learns a little bit of his place in the scheme, as a playtoy for Estella to learn her revenge against men.
We learn that she is the daughter of Magwitch and Molly. Molly is now working for Jaggers, and Magwitch is the convict that Pip helped in the marshland as a young boy. Molly wanted to kill the baby to get back at Magwitch. Magwitch was sent to Australia, and Estella was sent to live with Miss Havisham, so that she would be safe. Apparently no one realized how unstable she was (or cared)! Miss Havisham was so unstable because she was jilted at the altar on her wedding day.