Since the Treaty of Chanyuan, Emperor Zhenzong of Song wasn't sure if it was an illusion or reality, but he constantly felt that his court officials criticized him, the common people gossiped about his defeat, and even began to feel unworthy of being an Emperor.
But Emperor Zhenzong couldn't bear to leave the throne, so he began to believe in gods. His peculiar thought process was—if he could associate with immortals, then he would be counted among the divine lineage, and his right to the throne would naturally be legitimate and justifiable.
In fact, throughout history, most rulers have thought this way and have promoted it to the people as well. However, it's rare to see someone do it as superficially and obviously as Emperor Zhenzong.
Where there's a leading example, there will be those who follow to an even greater extent, this is a truth since ancient times.