Gensokyo was originally a desolate, haunted region of Japan ages ago. The youkai that lived there began to terrorize the surrounding lands, and thus powerful, heroic humans were sent to exorcise and exterminate them. The off and on battle between humans and youkai continued on until 1884 A.D., when Gensokyo was sealed off from this increasingly scientific and skeptical world with the creation of the Hakurei Border. There has been little contact between our societies ever since. Today, the only known gateway between Gensokyo and this world is the Hakurei Shrine, which stands in isolation along the border on distant mountains of the far east.
Gensokyo is populated mainly by youkai, but a decent human and rabbit population lives there as well. Some of its inhabitants went there to hide, to escape, to find shelter when no one and nowhere else would accept them. Many of them just like the natural darkness.