Shakespeare's comedy creates a dream world, which offers him an opportunity to escape rational order, social class, and prescribed behaviour in his writing. Lest he offend, Puck's speech at the end of the play entreats audiences to consider the piece a 'weak and idle theme, no more yielding than a dream'.
Demetrius comments 'It seems to me that we yet sleep, we dream.' His love for Hermia vanishes like a dream, replaced by love for Helena. In many ways he is still dreaming, still under the influence of Oberon's enchantment.
Bottom wakes, somewhat chastened by what he has experienced: 'Man is but an ass if he go about to expound this dream.' For Titania too, the dream has been a bitter one: 'Methought I was enamoured of an ass.' Hermia also has bad dreams - her nightmare of a serpent attacking her heart foretells Lysander breaking it in the following act.