First of all, the poems need to match the character's personality. Yu Jiaolong is the kind of rebellious, willful, official lady who has never experienced anything in the world; while Ziwei is a gentle, well-educated lady; these poems serve to highlight the character's image.
Secondly, this has something to do with the author of the novel. Wang Dulu, the author of "Crouching Tiger, Hidden Dragon", belongs to the tragic martial arts school, and Qiong Yao, the author of "Huan Zhu Princess", belongs to the romance school. The author's personality characteristics also affect the personality characteristics of his characters.