What does the flashback reveal about Hester's past?One way Hester endures her punishment is by dreaming of her past.
Hester's flashback from atop the scaffold is credited to her superior memory, which was, as the narrator says, "preternaturally active." She remembers all kinds of scenes from her childhood: being in school, playing, fighting with other children, and so forth.
Further, the narrator says that "it was an instinctive device of her spirit to relieve itself by the exhibition of these phantasmagoric forms, from the cruel weight and hardness of the reality." Her mind, by way of defending and preserving itself from the terrible judgments of the people come to gawk at her, has traveled back in time.
Soon, Hester's memories focus on her "paternal home" back in Old England; she was evidently from a noble family that had fallen on very hard times financially. Hester recalls looking into a mirror and seeing her own youthful reflection, as well as the reflection of a "man well stricken in years, a pale, think, scholar-like visage, with eyes dim and bleared by the lamp-light that had served them to pore over many ponderous books." He was quite a bit older than she, evidently a scholar who had spent his youth engaged with books.
However, in addition to illuminating his age and his deformity ("the left shoulder a trifle higher than the right"), Hester also recalls that "those same bleared optics had a strange, penetrating power, when it was their owner's purpose to read the human soul." Thus, this man seems to have a somewhat off-putting intuitive power: he can see the truth about people, see who and what they truly are. It is this very power that so frightens Hester later when he promises to find her co-sinner and seek his revenge. This description alerts us to this man's seemingly preternatural ability to see through someone's pretenses.
I assume you are talking about her thoughts while standing on the scaffold. Hester is consciously "checking out" while on the scaffold in order to endure the shame of this punishment. More importantly however, this flashback actually gives the readers necessary information for the rest of the book and foreshadows the identity of a new character.
In this flashback we learn a couple of things about Hester. First, she was married before she came to the New World - to a scholar/doctor. The man is generally described as old, unnactractive, learned and respected. A key detail is that one shoulder was higher than the other. Hester "never feigned" love for this man, even though he did what he could in his old age to provide for her. We also learn that he sent Hester on to the New World ahead of himself, he would follow after wrapping up some loose ends. He never showed up. It was assumed that he either shipwrecked, or landed and was taken captive by "savages."
Consider the implications of this information. Hester is/was unhappily married or widowed. Either is equally worse for her in her situation. Adultery between two unmarried adults would have been one thing in the colony - but in this situation, at least one of the sinners was married to someone else - which is worse. Then, at the end of the chapter, a man with one shoulder higher than the other has enters the colony with a "savage," catches eyes with Hester, and raises his finger (likely in a gesture of "shhh"). This is pretty obvious foreshadowing that Hester's "husband" has returned. How timely.