Touhou is set in a fictional region called Gensokyo, which is isolated from the Outside World by the Great Hakurei Barrier (which is less a physical barrier and more an imperceptible boundary). In Gensokyo, the supernatural is much more present than outside, particularly youkai and gods (a la Japanese mythology).
What’s a youkai?
If you aren’t familiar with youkai, they’re basically spooky supernatural stuff. If a thing happens and it’s spooky, someone’s probably thought up a youkai to explain it. Hear weird footsteps? Weird footstep youkai. Can’t find that old umbrella that you’re pretty sure was in your garage somewhere? It must have become an “abandoned item” youkai and wandered off. Hear a lawnmower at five in the morning but neighbors deny doing so when questioned? Phantom lawnmower youkai. Left sock went missing in the wash? Left-sock-stealing youkai. I made the last two up, but that’s the general idea.
In Touhou they take the form of anime girls, because anime girls are all ZUN can draw – and even that not very well. But we love him anyway.
Great Hakurei Barrier
The Great Hakurei Barrier is a “boundary of common sense” which allows youkai and gods to survive in Gensokyo even when the Outside World no longer believes in them. Thanks to this, most youkai and gods have relocated to Gensokyo in order to survive.
Similarly, Gensokyo is full of things that have been “forgotten” by the Outside World. These things have a tendency to start “slipping in” as they become less common in the Outside World – for example, paper started becoming more common in Gensokyo with the rise of digital storage, and the Japanese crested ibis was seen in Gensokyo after it became extinct in the Outside World.
Since the Great Hakurei Barrier has been in place since CE 1885, most youkai and gods remaining outside are those both powerful and stubborn enough to have survived. However, even these are eventually forced to move to Gensokyo. Since the Barrier is supposed to prevent entry, new arrivals tend to cause a stir (an “incident”) as Reimu, the grumpy human shrine maiden who maintains the Barrier (main protagonist), rushes to investigate the new mansion/shrine that suddenly appeared by the lake/on top of the mountain.
The aforementioned incidents were caused by the vampire Remilia Scarlet and the gods Kanako Yasaka and Suwako Moriya, respectively. The first was not the incident Remilia caused in her debut game, Embodiment of Scarlet Devil, but an earlier incident referred to only as the “vampire incident”.
The Vampire Incident and Spellcard Rules
At the time of the Vampire Incident, youkai were not allowed to prey on humans. This was enforced by the Hakurei shrine maiden (Reimu), whose ability to “float out of reality” made her essentially unbeatable.
Because of this, most youkai had grown weak from malnourishment (as spiritual beings, normal food doesn’t really work). So when Remilia gathered her servants and went on a rampage shortly after arriving in Gensokyo, it took several powerful youkai to eventually subdue her.
After this incident, it was clear that the current system wasn’t really working. A temporary solution was enacted involving spiriting away humans from the Outside World, but this solution was distasteful to many youkai (not out of any concern for the humans, mind you). Talks were held between Reimu and many of Gensokyo’s influential figures, leading to Reimu instituting the Spell Card system.
Essentially, the Spell Card rules are a way to level the playing field, replacing all-out combat with something akin to dueling. Each combatant is allowed to use an agreed number of spell cards, and the duel ends when one party has taken an agreed number of hits. Spell cards must be fair (Reimu is supposed to sign off on them), making it possible for weaker youkai and humans to stand up to strong youkai, and for youkai to defeat the Hakurei shrine maiden in a fair duel.
This made the Spell Card rules very appealing to youkai, as it meant they would be able to eat without being completely crushed by Reimu, and for some humans, as spell card duels are not supposed to be lethal (most youkai don’t need to kill humans to “feed” from them – it’s more “fulfilling their role as youkai”).
Ultimately, the Spellcard Rules are a sort of set of “ground rules for war”, much like we have in real life. The youkai don’t want to go back to Reimu curbstomping them whenever they try to eat; Reimu doesn’t want the youkai causing tons of trouble all the time. So all agree to abide by this “treaty”, limiting their own actions in exchange for the others being similarly bound. As long as everyone plays by the rules, nobody flips the board.
Role of humans in Gensokyo
In another sense, Spellcard Rules are somewhat like real-world regulations on fishing. To prevent the population of an important food source from becoming depleted, there are limits on how many you can kill and how you can go about killing them. Some areas, such as the village, are protected from being fished altogether.
That may sound harsh, but remember that Gensokyo’s role is that of a sanctuary for youkai and gods. Both of these need humans to survive, and so humans were brought to Gensokyo, and even protected by youkai from natural disasters.
Reimu, out of concern for her fellow “fish”, tried to ban “fishing” entirely, but this was short-sighted. Youkai prey on humans because that is their nature. This is the most important part of Gensokyo’s ecosystem.