Song of Eternal Sorrow is a long narrative poem, and all stories have their causes, processes and results. "The emperor of China longed for beautiful women who might shake an empire" can be understood as the cause of the whole story, which laid the groundwork for the subsequent coup and love tragedy. At the same time, it also shows the poet's position and attitude, that is, everything is caused by "attaching importance to beauty and thinking about the country"
So its greatest function is to lay the groundwork for this tragedy.