The speech works because it is a consolation that curdles. Duke Senior, exiled and cold, reaches for a comforting thought — other people suffer too, the world is a “wide and universal theater” full of sadder scenes than ours. Jaques, the play’s designated cynic, takes the metaphor off him and runs it to the end of a human life, cataloguing seven ages that begin with a mewling infant.
So the most quoted sentence in the play is not a thesis Shakespeare is advancing. It is a character seizing someone else’s figure of speech and pushing it somewhere bleaker than intended — which is exactly why it survives being lifted out of the scene and printed on a mug.
Shakespeare didn’t invent the metaphor. He wrote the version nobody could improve on.
The theatrum mundi tradition Shakespeare was working in
Life-as-theatre was a Renaissance commonplace before Jaques opened his mouth. Erasmus asks in The Praise of Folly (1511) what human life is “but a kind of play in which men in various costumes perform until the director motions them off the stage.” Richard Edwards’ play Damon and Pythias, written the year Shakespeare was born, has: “Pythagoras said that this world was like a stage / Whereon many play their parts.” Behind both sits a Latin tag attributed to Petronius, quod fere totus mundus exercet histrionem, which circulated widely in Shakespeare’s England ↗.
That the idea was second-hand is the point rather than a debunking. Shakespeare’s contribution is compression: eleven syllables that do what a paragraph of Erasmus does, in a line short enough to remember.