The imperial rulers moved the capital to Kyoto originally to escape from the growing domination of the Buddhist authorities of Nara.
The growing power of Buddhism was the reason why the rulers moved the capital to Kyoto.