It is a locution with various meanings, some clearer such as "suckcocaine" or in the nineteenth century "aspirating snuff", but the most used is to "maintain a sexual relationship". The origin seems to be right in the snuff, because to suck it without disturbing with the consequent sneeze, the knights and ladies momentarily left a meeting and locked theself in some room. The excuse of going to (snuff) often disguised an encounter between lovers; until this became the most common situation, and the phrase became an irony used to this day.