There is the gradeschool myth that Far East spices, including pepper, were used to cover the taste of rotting meat. But recent scholarship suggests that if a family could afford spices from the Far East, they could also afford freshly slaughtered meat–which logically, makes sense.
However, the old legend may not have been entirely wrong, just misinterpreted. A 1998 study by Cornell showed that black pepper, as well as many other spices, have antimicrobial qualities. Ground white and black pepper kill up 25% of bacteria they come in contact with, although pepper doesn’t hold a candle to garlic, onion, allspice and oregano, which kill 100% of bacteria. So, perhaps meats of the Middle Ages weren’t highly spiced to hide the flavor of rotten meat, but to actually stop the meat from rotting.
Pepper, therefore, acts as a preservative by keeping microorganisms at bay. Early Americans seemed to be aware of pepper’s preservative properties. There’s a bizarre story recounted in the 1949 book Pepper and Pirates of a seafaring man who died far from home in the early 19th century, and he “was shipped back to Salem in a coffin filled with pepper.” Apparently, his body made it back little worse for the wear.