Dorine is Mariane's maid. She's also saucy, sassy, and streetwise. She's always ready with a snappy comeback and some good advice. Without Dorine, Mariane probably would have folded under pressure from Orgon and married Tartuffe. Yuck.
Now, Dorine isn't sassy for sassiness's sake. She needs it to survive. She's a servant, after all, so she doesn't have the benefit of a wealthy father or whatever limited education a rich girl would get. (Molière actually deals with this problem in his L'École des femmes (The School of Women). As such, she doesn't have the deep intellectual resources that Cléante uses, and she isn't prone to Damis's testosterone-fueled outbursts. In short, she lives by her wits.
Now, this is a good thing and a bad thing. On the plus side, it allows her to befuddle those with less agile intellects, like Orgon. Check out this interchange, which occurs just after Orgon tells Mariane that she's to marry Tartuffe:
It's for your own sake that I interfere
(She repeatedly interrupts Orgon just as he is turning to speak to his daughter.)
Most kind of you, Now hold your tongue, d'you hear?
If I didn't love you…
Spare me your affection.
I'll love you sir, in spite of your objection.
Dorine's strategy is really rather simple. She stifles Orgon and stalls his plans. It's the only way she can exert any power. This tends to get her threatened by the higher-ups – Orgon eventually tries to slap her, in this case – but it also proves effective. Her tactics give Dorine and the rest of the family enough time to convince Orgon that he's wrong about Tartuffe.
The same energy and confidence that allows her to disagree with Orgon makes her a perfect companion for the young, weak-willed Mariane. She's also the perfect complement to Cléante. Her wit, coupled with his intellect, makes for a powerful combo.