Can be understood as: frustrated people, people in adversity, can write good poems and articles.
The "Palace" here is a poem with literary talent and skill. As the saying goes, work on poetry and fu.