"Emperor Taizong is really a long-term strategy, earning heroes and doing the friendship of landlords!"
This poem is related to the imperial examination system.
The last sentence means that Emperor Taizong and Li Shimin adopted the imperial examination to select talents, which is a long-term strategy.
In the next sentence, he began his career as a scholar, "aiming to show his ambition in a cage", and as a result, he earned all the heroes in the world and lost his head himself. Some people say that "heroes grow old", which means that since the imperial examination system, some of them have died of old age in the field of literature, and they have nothing to hate.