■ Capitals were the places where the Emperor lived.
The current capital of Japan is Tokyo. In Japan's history, the national capital has been in many locations other than Tokyo.
Historically, the home of the Emperor was considered the capital.
Three major capitals are Heijo-kyo (present day Nara), Heian-kyo (present day Kyoto), and Edo (present day Tokyo).
■ Heijo-kyo, present day Nara
Heijo-kyo became the capital in 710 and lasted for nearly 70 years.
During this Nara period, the Imperial Court led by the Emperor governed the country.
■ Heian-kyo, present day Kyoto
Heian-kyo became the capital in 794 and lasted a little more than 1,000 years.This period can be divided into two parts.
(1) Heian period
The former 300 years period is called as the Heian period when the Imperial Court had political power.
(2) Samurai dominated periods
The latter 700 years period can be called samurai dominated periods.
Samurai have established military governments called the Shogunate in Kamakura, then Muromachi (in Kyoto) and Edo, present Tokyo.
Kyoto has been the capital even after the emperors had lost political power.
In 1868, the Meiji Restoration occurred, and the political power was transferred from the Shogunate to the Imperial Court, which was the government lead by the Emperor.
The Meiji Emperor moved to Tokyo from Kyoto.
Tokyo has been the capital of Japan since then.
I hope this helps you appreciate the transition of capitals in Japan.