As Sir Toby, Sir Andrew, and Fabian, one of Olivia's attendants, wait in Olivia's garden, Maria runs in and instructs them all to conceal themselves inside a tree because Malvolio—who has been in the sun, practicing elegant mannerisms—is coming! They hide. Maria rushes off.
The prank creates a kind of play-within-the-play. Under Maria's direction, Malvolio, who acts phony all the time anyway, will become an unwitting actor for a hidden audience.
Malvolio enters, talking to himself. As it happens, he already believes that Olivia fancies him. Hiding in the tree, Sir Toby, Sir Andrew, and Fabian try to suppress their laughter, as Malvolio fantasizes about how wonderful it would be to marry Olivia and become a count. Suddenly, Malvolio breaks off: he has caught sight of the letter that Maria planted in his path. Inside the tree, Sir Toby, Sir Andrew, and Fabian can hardly contain themselves. Malvolio immediately recognizes "Olivia's" handwriting and seal. He opens the letter and starts reading it aloud. It says that Olivia has a secret love she will call "M, O, A, I" (2.5.131). After some puzzling, Malvolio concludes that these letters must refer to him. He reads on. The letter instructs that, if "Olivia's" beloved finds it, he must indicate that he reciprocates her feelings by being surly with the servants, wearing yellow stockings, crossing his garters at the knee, and smiling all the time. Overjoyed, Malvolio resolves to do all of these things and hurries off.
Malvolio's materialistic motivations for wanting to marry Olivia reveal how selfish his love is—he wants to marry Olivia not because he loves her, but because he loves himself and wants to rise in rank. Both his desire to promote himself through marriage, and his arrogant willingness to believe that Olivia loves him—however improbable that may be—make this play-within-the-play a kind of satire of love. Toby, Andrew, and Feste, mirroring the position of the actual audience watching Twelfth Night in the theater, further draw attention to theme of performance.
Sir Toby says he could marry Maria for thinking up this prank. Sir Toby, Sir Andrew, and Maria then rush off to watch Malvolio make a fool of himself.
Toby loves Maria for what she does, while Orsino seems to know nothing about Olivia. From now on, Toby, Andrew, and friends will be Malvolio's audience.