What was happening in 1650?
The English Civil War broke out in 1642 and still wasn't officially over by 1650. Charles I was executed in 1649, and his son, later to be Charles II, was exiled. In 1650 England therefore had no monarch, and existed as the Commonwealth of England, a republic under the leadership of Oliver Cromwell. It was therefore a time of great instability and uncertainty, which is often apparent in the book.
As Mary Hooper pointed out in a note at the end of the book, a statute was passed in 1624 that effectively made an unmarried woman guilty until proven innocent. After this statute became law, it became a capital (which means punishable by death) offence for unmarried women to conceal the birth of a child. It's worth noting that it's only in the past 30 years or so that illegitimacy has become accepted/more acceptable.
According to this website, it has been argued that convictions for infanticide between 1580-1700 resulted in more executions than the witch craze of the same period. The unmarried mother needed at least one witness to prove that her child had been born dead. Even if she was able to do this, often she was still sentenced to death for the crime of concealing a child, which shows that the statute was just as much to prevent illegitimacy as to punish infanticide.
Hanging was a common form of execution in England, with the first hangmen records dating from the 1360s, and the last hanging being surprisingly recent, in 1955.
The picture to the left is a common hangman's scaffold. A noose would be fastened around the person's neck, and a trap door under their feet would be opened. If the noose was knotted properly, and the knot was in the right place, the person's death would be quick, as their neck would be broken by the pressure put on it during the fall. If it wasn't, death would be from suffocation, and could take a lot longer. As I've mentioned before, it could be sped up by friends/family pulling and swinging from the person's legs.
A macabre thing to note is that hangings were, most of the time, public, and many people attended, as it was a popular form of entertainment. If you think about it, it makes sense as there was likely to be little to do for fun in those times, but it's still not a nice thing to think about!
How did she survive?
As Mary Hooper mentions in the back of the book, it is likely that the knot of the hangman's noose was in the insufficient place to break Anne's neck, meaning that death would have taken longer while she suffocated. Friends hanging off her legs (as they did) would have made it slightly quicker, but it still wouldn't have been instantaneous. It was a really cold day, too, and she wasn't wearing very much, so the most likely explanation for her survival is cryogenic preservation. Sub-zero temperatures mean that the brain is frozen, and therefore can't be starved of oxygen, which is what causes death.
Given the religious fervour of the time, Anne's recovery prompted officials to grant her a pardon. It was felt that god had sent a sign of Anne's innocence, and as such would be blasphemy to sentence her to death a second time. Something that strengthened this view was the illness and death of Sir Thomas Reade a couple of days after Anne's recovery. Given that he had ensured Anne did not receive a fair trial in the first place, this was seen as a further omen of God's will.
Going off on a tangent, while instances like this were rare, it would have been similar cases (or other medical anomalies) that made it necessary for the 'saved by the bell' legend in the 17th and 18th centuries. The picture to the right is a drawing of a 'safety coffin'. The hand of the deceased was attached to a bell, so if they, by some weird chance, woke up while buried, they could ring it and be saved. This followed stories written by Edgar Allen Poe and rumours of corpses being dug back up with scratch marks on the inside of the coffin.