The world of The Twelve Kingdoms seems quite rich, with a complicated history of the kingdoms, and a backstory of major world events and people. What I'm wondering is, are the Twelve Kingdoms based on historical kingdoms, or just created from whole cloth?
Twelve kingdoms possibly derives some loose inspiration from the Wei, Shu, and Wu Chinese kingdoms of the 3rd century CE which are popularly referred to as the Three Kingdoms.
The Three Kingdoms (AD 220–280) were Wei (魏), Shu (蜀), and Wu (吳). The Three Kingdoms period, part of the Six Dynasties period, followed the loss of de facto power of the Han Dynasty emperors. In a strict academic sense, it refers to the period between the foundation of the state of Wei in 220 AD and the conquest of the state of Wu by the Jin Dynasty in 280.
The story of the three kingdoms was romanticised and immortalised in the 14th century by Luo Guanzhong as The Romance of the Three Kingdoms.
Romance of the Three Kingdoms is acclaimed as one of the Four Great Classical Novels of Chinese literature; it has a total of 800,000 words and nearly a thousand dramatic characters (mostly historical) in 120 chapters. The novel is among the most beloved works of literature in East Asia, and its literary influence in the region has been compared to that of the works of Shakespeare on English literature. It is arguably the most widely read historical novel in late imperial and modern China.
The novel is well known throughout China, Korea, and Japan. I am unfamiliar with the story to comment on any similarities in plot or structure. But as a guess, I'd say that beyond the fact that the societies in Twelve Kingdoms are similar to feudal Japan/China, there are no major similarities.
There are, however, some obvious Buddhist influences. For example, the very geography of the Twelve Kingdoms is shaped like a lotus with a harmonious, magical centre (the yellow "sea") which has huge mountain ranges. There are also eight petals for the eight inner kingdoms with their eight kings.
The lotus in Buddhism (and other religions out of India) is representative of the Eight Fold Path, and various other interpretations involving the number eight (directions, etc.). Buddha sits in the centre and holds things together. There's also a Mount Meru in the centre which serves as the world's axis.
I'm not entirely sure how the four outer kingdoms fit in, going by the above image, there probably is some exotic symbolism for the corners.
Some Eastern animal symbolism which has crept into Buddhism is also present in Juuni Kokuki. For example, all life is hatched from ranka, eggs which grow on trees. Compare this with the following image of Buddha being hatched from a "cosmic egg":
FWIW, Korean history has its own Three Kingdoms.