In Chapter 13 of The Scarlet Letter, seven years have passed since we first saw Hester and baby Pearl on the scaffold. Hester has changed and has begun speculating about her life as well as her abandonment of the Puritan society's values. If her Puritan neighbors has known that she would be in more trouble than just from committing adultery.
The years of punishment have open caused her mind to open to new ideas. These new ideas are compared to revolutionary ideas where men have fought against traditional ideas which have imprisoned them. Men who have disagreed have "overthrow nobles and kings" or been willing to fight against those in power.
The world’s law was no law for her mind. It was an age in which the human intellect, newly emancipated, had taken a more active and a wider range than for many centuries before. Men of the sword had overthrown nobles and kings. Men bolder than these had overthrown and rearranged—not actually, but within the sphere of theory, which was their most real abode—the whole system of ancient prejudice, wherewith was linked much of ancient principle.
Like these men, Hester is drinking ("imbibing") the spirit of freedom, and so her thoughts turn to leaving Boston and the controlling Puritan ideas.
Hester Prynne imbibed this spirit. She assumed a freedom of speculation, then common enough on the other side of the Atlantic, but which our forefathers, had they known of it, would have held to be a deadlier crime than that stigmatized by the scarlet letter.
So, while Hester spends her time alone, her thought begin to drift. In a society whose ideas are as uniform and constricting as the Puritan society, the powers that be would not be thrilled about her day dreams.
In her lonesome cottage, by the seashore, thoughts visited her, such as dared to enter no other dwelling in New England; shadowy guests, that would have been as perilous as demons to their entertainer, could they have been seen so much as knocking at her door.