It is easy for Viola, disguised as Cesario, to get to see Olivia. She has been sent by Duke Orsino to woo Olivia for him, but instead, Olivia has fallen in love with Viola/Cesario, thinking she is male. Because Olivia is in love with Cesario, she is always glad to see him/her and, in fact, pretends more interest in Orsino than she feels in order to have opportunities to meet with Cesario.
In other words, Viola's disguising herself as male has caused all sorts of zany mishaps, all of which help fuel the comedy of the play. Viola is in love Orsino and doesn't want to be wooing Olivia for him. However, since Orsino thinks Viola is male, she can't very well confess her love for him. Likewise, she can't tell the lovesick Olivia that Cesario is actually female.
Luckily for this comedy, Viola's identical twin brother, Sebastian—believed to have been drowned in the shipwreck that stranded Viola on Illyria—shows up. Olivia mistakes him for Cesario and marries him, leaving Viola free to reveal her true identity and marry Orsino.
Shakespeare enjoyed switching gender roles in his comedies and did so in ways that showed that women, such as Viola, are just as competent as men when given the chance to show their abilities.