You get a hankering for a peanut butter and jelly sandwich, and after rooting around in the pantry you discover a neglected plastic jar of PB — score! But you’re a little worried about how long it has sat back there consorting with the pretzels. You unscrew the brightly colored lid and peek inside — no green or white fuzz — and a timid sampling confirms it still tastes good. It’s time to slap together a big, sloppy PB&J.

Peanut butter is gooey and delicious, yet it can remain at room temperature for months without spoiling. Low moisture levels and high oil content keep this butter from going bad for quite some time, but don’t go ignoring that expiration date just yet. Peanut butter can go rancid in about a year and lose its flavor. While fungi and bacteria won’t ruin your peanut butter, oxygenation eventually will.

The axiom that tasty foods are fatty foods is certainly true in the case of peanut butter. Label-lookers will notice that peanut butter is full of fat, sporting some 16 grams in a two-tablespoon serving. In addition to its natural peanut oil, peanut butters often contain other vegetable oils such as cottonseed, soybean and rapeseed. Since oil and water don’t mix, the more oil there is, the less room there is for water.

So despite feeling wet and greasy, peanut butter is actually extremely dry, with a moisture content of about 2 percent, according to Lydia Botham, the public affairs director for Land O’Lakes Inc. Without water, most bacteria and fungi can’t survive. Aridity is the chief way that peanut butter and other unrefrigerated comestibles, such as pasta and cereal, hold corruption at bay. For comparison purposes, butter from an udder has somewhere in the range of 17 percent water by volume, and must therefore be kept at a chilly temperature to retard bacterial and fungal proliferation.

But peanut butter’s dryness doesn’t guarantee immortality. In fact, the high fat content leaves PB vulnerable to a different type of food spoilage called rancidification. This isn’t the same as oil separation, when the fats disassociate from peanut particles and pool on top of the jar’s contents. This happens normally in peanut butter and can be resolved simply by stirring.

Instead, rancidification is a chemical process in which oxygen breaks down the molecular structures of lipids (the technical term for fats) and changes the flavor and odor of food in rather unappetizing ways. As peanut butter is exposed to more and more oxygen over its lifetime, it becomes likelier to undergo this decay.

Fortunately, peanut butter is blessed with high amounts of the natural antioxidant vitamin E. This nutrient helps stave off oxidation and prolongs PB’s shelf life, according to Richard Faulks, a senior scientist at the Institute of Food Research in Norwich, England. Even so, rancidification typically sets in about nine to 12 months after purchase, hence the “Best If Used By” that appears on the container.

Health-wise, however, rancid peanut butter is not something to really worry about. “It won’t hurt you if you eat it — it will just taste bad,” says Maribeth Cousin, a professor of food science at Purdue University in Indiana. “Some people actually eat rancid food without knowing it, depending upon their individual taste buds.”

So maybe the peanut butter that you rescued from culinary limbo, which is now cementing your mouth closed as you crush that PB&J, is actually rotten and would taste disgusting to anybody else. As you reflect on the last few nibbles, you may ponder the biggest question about peanut butter, and one that science can’t answer: So which is better anyway, crunchy or smooth?