The allegory in chapter 16 is that, as Hester tried to find Dimmesdale in the dark forest to speak to him about Chillingworth, the sun in the dark forest seemed to accumulate itself as a dim ray of light that continuously evaded Hester. Even Pearl, her daughter, asked her mom how come the sun "did not love her", and yet Pearl was able to soak in the light and beam with a certain preternatural joy that made her seem almost surreal in comparison to other children whom, like the story says, inherit the sadness and shame of their ancestors.
The allegory is that Pearl may very well be the being, or entity which has soaked up the persona of Hester. Because of Pearl Hester had to stop seeing the man she fell in love with due to the shame of being pregnant by him. Because of Pearl as well, she has been shun away from society, lives in shame, and suffers in isolation. Pearl, on top of all that, is a challenging child who has almost guessed the entire situation surrounding her mother: She is a form of embodiment of Hester's true self, but she also sucks the energy, the life, and the joy out of Hester.
Therefore, Pearl even took the light away from Hester, and that is what is allegorical in this specific chapter.