Chapter 8 is a very important chapter because here we see Hester Prynne pushed to her limits by the threat of having Pearl taken from her. She can bear the shame of her sins, which include the humiliation of wearing the scarlet letter, but she could not and would not bear the loss of "her" Pearl.
It is at this point when the authorities are about to rule on the welfare of Pearl that Hester comments that Pearl is both her happiness and her torture, and she cannot bear to bear to lose her. It the the emphasis on the word torture that is directed at Dimmesdale. He knows that Hester is desperate and will reveal the "torture" of being silent as to Pearl's father. When Hester demands that Dimmesdale speak on her behalf, he quickly intervenes by saying that Pearl's presence helps to save the mother's soul. Knowing that Dimmesdale's words would carry great weight with the magistrates, and that Dimmesdale is Pearl's father, Hester believes he should speak on her behalf.