What inspires Maria to come up with her successful stratagem to make Malvolio look like a fool is the way that he challenges both her and Sir Toby, whom she hopes to marry, in Act II scene 3. This is the famous party scene, when Sir Toby and Sir Andrew, joined by Maria and Feste, stay up late one night engaging in drunken acts of tomfoolery. Although Maria does join in, she is slightly more reluctant about opposing Malvolio directly to his face. However, her presence does not go unnoted, and Malvolio addresses her directly before he leaves the scene:
Mistress Mary, if you priz'd my lady's favour at any thing more than contempt, you would not give means for this uncivil rule. She shall know of it, by this hand.
With these words, Malvolio exits the stage, but also with these words, he clearly challenges Maria to either disassociate herself with Sir Toby or to run the risk of leaving her position as Olivia's maid. Maria therefore comes up with a strategy for getting her own back on Malvolio but also to win the hand of Sir Toby. In this sense, she is allied to the forces of chaos and partying that are symbolically led by Sir Toby and face conflict with Malvolio, who represents the forces of sobriety and Puritanism that threaten to quench the spirit of the partygoers. Maria has of course a third motive: to show that Malvolio is just as capable of being ridiculous just as the rest of the characters in the play are, for all of his pretensions to be higher and mightier than the rest of them.