During the Kaiyuan era of the Tang Dynasty, the corrupt minister Yang Guozhong seized power, forming cliques and relying on his sister Yang Yuhuan, Emperor Xuanzong's favored consort, to dominate the court with arrogance. Many officials scrambled to flatter him, acting solely on his whims and obeying his every command.
The prime minister Zhang Jiuling, a man of integrity and straightforward character who despised sycophants, refused to associate with the powerful Yang Guozhong. Yang Guozhong harbored a deep grudge, and upright officials feared Zhang would be framed.
Zhang Jiuling replied, "Look at the court today—those who curry favor are nothing but beggars huddling around a fire. They grin and preen, thinking they've gained something, yet they've gained nothing at all. When the flames die and only ashes remain, the wind will scatter those ashes, leaving no trace of warmth. Once that happens, these fire-warmers will freeze in the wilderness, their bones discarded in ditches. They strut now, utterly blind to the disaster looming over them."
That year, An Lushan, the military governor guarding the frontier, conspired with Yang Guozhong to launch a rebellion that nearly toppled Emperor Xuanzong of the Tang Dynasty. The emperor fled in haste with his beloved consort Yang Yuhuan. At Mawei Slope, the loyal imperial guards demanded that Yang Yuhuan, seen as the power behind the corrupt Yang Guozhong, be executed to save the nation. To preserve his throne, Xuanzong reluctantly ordered her to hang herself, while Yang Guozhong was also put to death.
Those who had curried favor with Yang Guozhong were punished one by one, some even suffering the extermination of their entire clans. This outcome, as Zhang Jiuling had sadly predicted, came true. Zhang Jiuling seemed guided by a divine spirit, truly possessing foresight.
Later, the idiom "Xiang Huo Qi Er" (a beggar warming by the fire) came to refer to those who curry favor with the powerful.
Source: *Kaiyuan Tianbao Legacy*
Meaning of the Idiom: Later, the Chinese idiom "向火乞儿" came to describe those who curry favor with the powerful.