Honey cheats the idea of shelf life. Not by magic, but by chemistry that leaves most microbes stranded. Real honey contains very little free water; its water activity is so low that bacterial cells cannot maintain osmotic balance and simply shut down. Add to that a pH typically well below neutral, and the usual microbial enzymes slow to a crawl or denature outright in the acidic stress.
This is not just pantry folklore. In concentrated sugar solutions like honey, osmotic pressure strips water from microbial cells, collapsing their membranes and blocking replication. The acidity, driven by gluconic acid formed from glucose oxidation, keeps many foodborne pathogens dormant. On top of that, the enzyme glucose oxidase in raw honey can generate trace hydrogen peroxide, a mild antiseptic that adds yet another barrier against spoilage. When honey does spoil, the culprit is almost always added moisture or adulteration, not the original product.