In Shrek, the titular ogre explains: "Onions have layers. Ogres have layers." This metaphor encapsulates his character arc:
The onion analogy serves both as comic relief and a thematic statement: people (and ogres) are more complex than their surfaces suggest. It foreshadows Shrek's emotional opening throughout the film.