Picture a path up a wooded hill in southern Kyoto, roofed by bright orange-red gates set so close together that they form a tunnel. You walk through it, and the gates keep coming. This is Fushimi Inari Taisha, one of the best-known shrines in Japan, and the gates are what people come to photograph.

Then you start to notice the foxes. Pairs of stone foxes sit by the shrine buildings, and more sit along the path, many of them wearing a red bib. Look closely and a lot of them are holding something in their mouths: a round jewel, a key, a sheaf of rice.

So who are they? Are they the god of the shrine? And why a fox, of all animals?

The foxes are not the god

The short answer, from the shrine itself: the foxes are messengers. The god of Fushimi Inari is called Inari, one of Japan’s many gods, and the shrine’s own question-and-answer page says it plainly: the fox is Inari’s messenger, a servant of the god.

Inari began as a god of rice. In a country that lived on rice, that meant a god of food and of the harvest, the thing a whole year of work depended on. The shrine dates its founding to the year 711. Later, Inari came to be worshipped as a god of business too, and in the cities of the Edo period (the 1600s to the 1800s) the worship spread enormously. Today there are said to be around 30,000 Inari shrines across Japan, from big ones like this to tiny shrines on office rooftops and in alleys between shops.

That also explains the gates. Each one was given by someone. People offer a gate as a prayer, or as thanks once a wish has come true, and the custom was already under way in the Edo period. Around ten thousand gates now stand along the paths on the mountain. Walk the tunnel and you are walking through a long row of prayers and thanks.

And the foxes? Strictly speaking, Inari’s messengers are not the foxes you might see in the hills. The shrine describes them as white foxes that no one can see, called byakko-san, “Mr. White Fox”. The stone foxes you pass are statues of those messengers.

Why a fox?

Nobody can point to a single moment when the fox got the job, and Japanese reference works give more than one explanation.

The oldest-looking one comes from the fields. Long before Inari became a business god, farmers believed in a god of the rice field, and in many places they treated the fox as that god’s helper. Japanese reference books note that the small “fox mounds” (kitsunezuka) found in many places were once where people worshipped the field god. Foxes lived at the edges of the paddies and came and went with the seasons of the crop. When rice farming and the worship of Inari joined, the fox came along with it.

A second comes from Buddhism. Inari was also joined with a Buddhist deity called Dakiniten, who in Japan came to be seen as a fox spirit. Once the two were treated as related, the fox could pass from one to the other.

The things in their mouths vary from statue to statue: a sacred jewel, the key to a storehouse, ears of rice.

The fox that plays tricks

If you know anything about foxes in Japanese stories, this might seem odd. In folk tales, the fox is usually up to no good. Japanese reference works describe the fox as an animal that was said to trick people, fool them, and even possess them. The same works also list the fox as Inari’s messenger.

So one animal plays both roles, a messenger from a god or a trickster who leads a traveller astray. Which one you meet depends on the story, much as Japan’s gods and monsters can turn out to be one being seen from two sides.

There is a friendlier link between the fox and Inari too, and you can eat it. Fried tofu, aburaage, has long been said to be the fox’s favourite food, and people offer it at Inari shrines. That is why sushi rice wrapped in a pouch of sweet fried tofu is called inari-zushi, and why udon noodles topped with a big slice of it are called kitsune udon, “fox udon”. The story goes that the dish was born in Osaka in the Meiji era (1868 to 1912), when a noodle shop served the fried tofu meant for inari-zushi on the side.

Back at the gates

So the next time you see one of those stone foxes on the path, you know what it is doing. It is not the god. It is standing guard for a rice god who became a business god, holding a jewel, a key or a sprig of rice in its teeth, while people walk past under thousands of gates given as prayers and thanks. And if you order fox udon later that day, you will be eating its favourite food.