How are China's ancient poems preserved?

Basically, look at the records. After the poet (word) is created, it will be circulated by many people, so it will be recorded by those historians. Or such a collection of poems (words) was compiled by a willing heart, so it will be preserved! Of course, after the baptism of the beacon fire, many excellent poems have long been lost, and we can't see them at a glance. I hope I can help you.