Allegory is known as an extended metaphor whereby a long narrative is used to teach a lesson or prove a point from an absurd, unrelated story. The story usually has an implied and literal meaning.
So, a writer that comes up with an outrageous solution to poverty just to highlight the heartlessness and absurdity of the rulers he lives under uses an allegory to tell his story.