Two Definitions of Allegory:
A symbolic fictional narrative that conveys a meaning not explicitly set forth in the narrative. Allegory, which encompasses such forms as fable, parable, and apologue, may have meaning on two or more levels that the reader can understand only through an interpretive process.
Encyclopaedia Britannica
An allegory is a story, poem, or painting in which the characters and events are symbols of something else.
Collins Dictionary