Twelfth Night was the festival held on the night of the 5th January (12th night after Christmas), and the night before the Epiphany, the time the Three Wise Men visited Jesus. This gives rise to its French name, "La Nuit Des Rois".
In medieval and Tudor times, this festival was by tradition very rowdy (it is possible that 12th Night was derived from the Roman festival of "Saturnalia", held in December, which was renowned for its revelry). One of the activities was a masquerade, in which everyone wore masks to conceal their identity, therefore also concealing their rank in society. Another activity was mock "King-for-a-Day", in which a member of each household was chosen by lottery to be "King". It is consequently quite likely that a child or servant could be chosen, and they would preside over their elders or masters respectively. A director would be specially appointed for the festival. In England he was called "Lord (or Abbot) of Misrule" and in Scotland, "Master of Unreason"
In 1601, there were particularly spectacular festivities, as it was the turn of the century, and the Queen, Elizabeth I, invited Don Virginio Orsino to the Palace of Whitehall for the celebrations. This event gives rise to the theory put forward by Leslie Hotson, in his book, "The Fist Night of Twelfth Night", that this particular William Shakespeare play was specially written for that occasion.
All the activities of the festival have parallels in the play. There is the suspension of normal relations between servants and masters, the equivalent of the mock "King-for-a-Day" in the festival. The servants and masters fall in love with someone of the opposite class. Olivia (master) loves Cesario (servant), Cesario loves Orsino (master), Malvolio (servant) loves Olivia and also enjoys the fantasy of dominating Sir Toby Belch, his master. Sir Toby is in love with Maria (servant), and she with him.
The masquerade is represented by the impersonations that take place in the play. Viola impersonates Cesario and she also, involuntarily, impersonates her brother, Sebastian, and vice-versa. Feste impersonates the priest, Sir Topas, while Maria impersonates Olivia via her handwriting. Antonio denies his identity to try and escape arrest. Other deceptions that take place are: Viola and the Sea Captain deceiving all the characters that Viola is Cesario; Sir Toby tricks Sir Andrew Aguecheeck into thinking he is his friend, in order to obtain drinking money; Sir Toby Maria, Sir Andrew, Fabian and Feste all trick Malvolio into thinking that Olivia is in love with him; Sir Toby and Fabian fool Cesario and Sir Andrew into thinking that the other wants a duel, and that their opponent is a distinguished fighter and Olivia deceives Malvolio that Cesario has left a ring with her, so Malvolio will take the ring to Cesario, without suspecting a thing.
The riotous behaviour is reflected in the late-night drinking sessions of Sir Toby, Sir Andrew, Maria and Feste.
Even the serious themes of the play reflect aspects of the festival. The "Lord of Misrule" would welcome the failure to rule or control the behaviour of a number of characters in the play. Orsino's excessive love, Olivia's immoderate grief ,Sir Toby and friends' "uncivil rule", and Malvolio's fantasies of grandeur.
The "Master of Unreason" would of delighted in the most unlikely, and unlikely attractions between many characters in the play. Orsino, Malvolio and Sir Andrew for Olivia, Olivia for Cesario and Sebastian, Maria for Sir Toby and vice-versa, Viola for Orsino and maybe also Antonio for Sebastien. In addition there is a madman, Feste, who is very clever but plays the fool professionally, while there is also a man, Malvolio, who is made to look the fool.