The topic is the twenty two shrines sponsored by the imperial government in the Heian Period. How and when did such a list originate? It seems that sometime in the early 10th century there were complaints about the size of offerings given to the shrines and the lack of dignity that was afforded those gifts. Some of the priests were selling or consuming the offerings before they arrived back to their shrine. (Bowring, Richard.
Religious Traditions of Japan. Cambridge p.189)
This may have led to a drastic reduction in the number of shrines which were called to give official prayers to stop the rain in 966. Only 16 shrines were requested for this special event. (Compare that number with the 2,861 shrines recognized and supported in Yoro Code in 718 which was then reduced to 573 official state shrines in 798)
According to Namiki Kazuko in the Encylopedia of Shinto, "In the mid Heian, 16 shrines (Ise, Iwashimuzu, Kamo, Matsuno-o, Hirano, Inari, Kasuga, Ōharano, Ōmiwa, Isonokami, Ōyamato, Sumiyoshi, Hirose, Tatsuta, Niukawakami, Kibune) were first included in this system. This was followed by the inclusion of Hirota shrine and then, somewhere during the latter half of the 11th or early part of the 12th century (during the reign of the Ichijō court), Yoshida, Umenomiya, Kitano, and Gion shrines were subsequently added (in that order). It appears that during the Insei period Hie shrine was further included in this grouping. Under the Taira reign in the mid-Heian, a plan to include Utsukushima Shrine was created, but it was never realized, leaving the final number of shrines in the system at 22."
Here are the names and locations of the 22 shrines:
Upper seven ------- name/ current name/ location
1. (神宮) Jingū (also Ise Jingū 伊勢神宮), Ise, Mie
2. Iwashimizu Hachiman-gū (石清水八幡宮) Iwashimizu Hachiman-gū Yawata, Kyoto Prefecture
3. Kamo Jinja (賀茂神社)
a) Kamo-wakeikazuchi Jinja (賀茂別雷神社), a/k/a Kamigamo Jinja (上賀茂神社) Kita-ku, Kyoto
b)Kamo-mioya Jinja (賀茂御祖神社), a/k/a Shimogamo Jinja (下鴨神社), Sakyo-ku, Kyoto
4. Matsunoo Jinja (松尾神社), Matsunoo Taisha, Ukyō-ku, Kyoto
5. Hirano Jinja (平野神社), Hirano Jinja, Kita-ku, Kyoto
6.Inari Jinja (稲荷神社), Fushimi Inari Taisha (伏見稲荷大社), Fushimi-ku, Kyoto
7. Kasuga Jinja (春日神社), Kasuga Taisha Nara City, Nara
Middle seven1. Ōharano Jinja (大原野神社), Ōharano Jinja, Nishikyō-ku,Kyoto
2.Ōmiwa Jinja (大神神社), Ōmiwa Jinja, Sakurai, Nara
3. Isonokami Jinja (石上神社), Isonokami Jingū, Tenri, Nara
4. Ōyamato Jinja (大和神社), Ōyamato Jinja Tenri,Nara
5. Hirose Jinja (廣瀬神社), Hirose Taisha Kawai, Nara
6. Tatsuta Jinja (龍田神社), Tatsuta Taisha Sangō, Nara
7. Sumiyoshi Jinja (住吉神社), Sumiyoshi Taisha Sumiyoshi-ku, Osaka
Lower eight1. Hie Jinja (日吉神社), Hiyoshi Taisha, Otsu, Shiga
2.Umenomiya Jinja (梅宮神社), Umenomiya Taisha Ukyō-ku, Kyoto
3 Yoshida Jinja (吉田神社), Yoshida Jinja, Sakyō-ku, Kyoto
4. Hirota Jinja (廣田神社), Hirota Jinja, Nishinomiya, Hyōgo
5. Gion-sha (祇園社), Yasaka Jinja (八坂神社) Higashiyama-ku, Kyoto
6. Kitano Jinja (北野神社), Kitano Tenmangū (北野天満宮), Kamigyō-ku, Kyoto
7. Nibunokawakami a/k/a Niukawakami Jinja (丹生川上神社) Niukawakami Jinja
Nakasha (middle shrine) Higashiyoshino, Nara
8. Kibune Jinja (貴船神社), a/k/a Kifune Jinja, Sakyō-ku, Kyoto
Interesting to note is that the Fujiwara Dynasty is represented on all three levels. Kasuga in Nara, Ōharano Jinja was their family shrine at the Nagaoka Capital. And finally, Yoshida was their "Kasuga" shrine in the Heian Capital.
In addition, all these shrines were closely connected with temples a few of them developed into megaplexes, i.e. large shrine-temple complexes. The best examples are: Kasuga-Kofukuji, Hie-Enryakuji, Iwashimizu Hachiman-Gokokuji, Gion-Kankeiji, Kitano-Kannonji.
In Heian Period these were the highest ranking shrines and enjoyed significant patronage. During the Middle Ages - Kamakura and Muromachi -this system became less important as official patronage declined.