The story
In 1586 Mary, Queen of Scots had been a prisoner in England for eighteen years. Her cousin Elizabeth I kept her in a series of country houses, the latest of them Chartley Hall in Staffordshire, and cut off her letters. Then, early that year, a way out seemed to open: a young Catholic exile, Gilbert Gifford, arranged for letters to travel in and out hidden in a waterproof case inside the bung of the beer barrels delivered to the house.
What Mary did not know was that Gifford was working for Sir Francis Walsingham, Elizabeth's secretary of state and spymaster. Every letter went to Walsingham's decipherer, Thomas Phelippes, who copied it, broke it, and sent it on.
The plot and the postscript
In July a young Catholic gentleman, Anthony Babington, wrote to Mary about a plan: foreign troops would land, Mary would be freed, and six gentlemen would deal with Elizabeth. Mary's long reply, sent on 17 July, approved the plan. When Phelippes deciphered it he is said to have drawn a gallows on the copy.
Walsingham wanted the names of the six. So Phelippes, imitating Mary's cipher, added a forged postscript to her letter asking Babington for the names and qualities of the six gentlemen. Babington was arrested in August before he could answer in full. He and his fellow plotters were executed in September. Mary was tried in October, found guilty, and beheaded at Fotheringhay Castle on 8 February 1587.
How it was broken
Phelippes had the two things a codebreaker needs: plenty of letters in the same cipher, and the patience to count. A nomenclator's word signs and nulls make the job slower, but the bulk of every letter is still spelt out with one sign per letter, and the commonest signs give themselves away. Once a few letters are known, the word signs can be guessed from their context.
The lesson cost Mary her life: a weak cipher is worse than none, because it makes the writer bold. She said things in cipher she would never have written in the open.