Soybeans have long been an important part of the Japanese diet. They are enjoyed in many forms — as edamame, tofu or yuba; boiled or roasted; ground up as flour; and so on. Soybeans also have religious significance, as we've seen this month during Setsubun, when roasted soybeans are thrown to signify the driving out of bad spirits.
There is one form of soybean, however, that is quite infamous: the sticky, pungent fermented version called nattō. Its gooey consistency and extreme odor can be baffling to Westerners, and it's far from universally loved in Japan as well: People from the west and south of the country tend not to like it. But people from the east and the north usually love it: the sticky-stringy texture, the fermented-cheese-like flavor and all.
It's not quite certain when or who first discovered that wrapping cooked soybeans in rice straw for a while would make them ferment and become soft and sticky. The earliest written record of nattō is from around the mid-11th century, but it is fairly certain that the food itself existed way before then.