Pop goes the weasel was sung by spinners when winding seins of yarn onto a swift. The weasel is a device that is used to tell the spinner when a certain amount of yarn has been wound on. The weasel is a sort of disk shaped piece of wood with a ratchet in it. There is a tab of wood that presses against the edge of the disk, and it snaps when it goes over the edge of the ratchet, making a popping sound. Thus, "pop goes the weasel".
The rest of the song is sung as the yarn is being wound on, and the "pop goes the weasel", part when the weasel snaps on the ratchet.