I saw Alan Ayckbourn's latest play Neighbourhood Watch last night, which is about a neighbourhood watch group that gets out of hand. At one point there is talk about whether they are to install stocks or a pillory on their estate, and one of the characters explains the difference.
Stock was one of the earliest words in English; it first meant a tree trunk and a few centuries later, a post or stake. Stocks are old instruments of punishment consisting of one plank of wood on top of another with holes cut out for the wrongdoer's ankles. The person would have to sit there unable to free his or her legs. These old stocks can often be seen in old English villages today. This meaning of stocks was first attested in the 14th century.
The word pillory also dates back to the 14th century. A pillory is similar to stocks; the difference is, though, that the victim stands up and the pillory holds fast his or her arms and head, not legs. The pillory as a form of punishment was outlawed in Britain in 1815, except in cases of perjury, and was abolished completely in 1837. Pillories are often seen, however, at school fêtes, garden parties and the like - often a hapless teacher or prefect (a volunteer, I think!) is fastened in the pillory while visitors throw wet sponges at him/her to raise funds.
The verb 'to pillory', meaning 'to expose to public abuse or ridicule', is quite common these days. Its original meaning was literally 'to put in the pillory'. There was once the verb, 'to stock', which meant 'to put in the stocks', but that is obsolete now.