The images of a Geisha, coupled with the Samurai and the many great battles, always conjure up the times of ancient Japan but like many misconceptions, these images are more associated with the Tokugawa era, rather than the Heian Era of Japan.
In 794 the capital of Japan had being moved to Heian-Kyo, which means "Capital of peace and tranquility" today it is known as the modern city of Kyoto. The Heian Era was a time of peace in Japan, a period of great art, the "Gagaku" which was the imperial court music also flourished, even poetry as well.
The Heian Era was the time of development of the kana, so also the spread of Buddhism, it was also during this time, that the Japanese began to focus on, developing their own concepts, and wanted to be independent of China. This is why Chinese influence on Japanese society greatly declined, during the Heian era because communications between these two nations ceased in 894.
In the Heian Era, the Emperor, who was also called "Tenno" was regarded as a figurehead ruler, it was the Fujiwara clan, who were also called "wisteria field" which means that they were the ones that held the real power during the Heian period.
The Fujiwara clan held so much power because of the many political wranglings, the weird inter-marriages within the Imperial court, as well as nepotism.
It is said that Fujiwara Yoshifusa had even personally, installed his own grandson as Emperor.
The end of the Heian era was brought about, due to the decline of effective rule by the government as well as the failures of the Taika reforms, as the tax structures put in place ended up heavily taxing, mostly the poor Japanese farmers but signaling out the many shrines and temples.
As a result both the state income, as well as public well-being were in turmoil, as could be expected there was also much danger because public outrage increased. The displaced peoples as well as the worried landowners, had now decided to protect themselves, thus ushering in the period of the samurai.