Symbolism, Imagery, Allegory
When you hear the words "chocolate cake," you probably think, "Yum!" not, "Ah yes, the cake, a clear literary symbol." Well, in Matilda, it's both.
A delicious chocolate cake makes such an important appearance in the book that it's even in one of the chapter titles: "Bruce Bogtrotter and the Cake." In this chapter, the Trunchbull has discovered that student Bruce has stolen some of her precious cake supply. To punish him, she forces him to eat an enormous cake during a school assembly:
Suddenly the Trunchbull exploded. "Eat!" she shouted, banging her thigh with the riding-crop. "If I tell you to eat, you will eat! You wanted cake! You stole cake! And now you've got cake! What's more, you're going to eat it! You do not leave this platform and nobody leaves this hall until you have eaten the entire cake that is sitting there in front of you! […]" (11.67)
The Trunchbull thinks that there's no way Bruce will eat the whole thing, and there's no better way to punish him than through certain illness (after all, that's a huge cake) and public embarrassment. You could say that he took some of her control away by swooping in and stealing cake that wasn't his to take, and the Trunchbull is trying to take that control back by telling him what he has to eat, how much, and when. The fact that he's not hungry is, well, not important. Because the Trunchbull is calling the shots now. And she doesn't care.
But ultimately Bruce triumphs over the Trunchbull, and eats every last bite of that huge cake. He succeeds even when she sets him up to fail, and doesn't seem to suffer too much (since when have you heard anybody complaining about having to eat a baked good?).
So her whole punishment backfires. She looks powerless next to him, and he becomes a temporary hero to the rest of the school. It's a glorious moment for all those students who have felt the wrath of the Trunchbull. For this brief moment, her wrath isn't so awful. In fact, it's nonexistent. She has been defeated, at least for the time being.
What's so great about this scene is that finishing the cake wasn't a prank Bruce planned, but it hurts the Trunchbull's ego even more than all those carefully plotted pranks (like the itching powder) do, because he took a situation that was supposed to humiliate him and used it to humiliate her instead. Go Bruce!