In the the Middle ages, an illustrated text called a bestiary was used to teach moral lessons. People believed that all living things had meaning, reflecting the word of god, so a collection of animal pictures could be used to instruct people. The animals, and the lessons, were not always…consistent with reality. For example, beavers were hunted for their testicles (used to make medicines). A beaver will bite off its testicles, and throw them at a hunter, to escape capture. So, following this example, a man should cut off his vices and throw them at the devil.
In this image, you can see the poor critter with his balls in his mouth: