The play's title refers to the dreamlike qualities of romance. It also refers to the yearning to escape the mundane or troublesome qualities of marriage that are portrayed in Titania and Oberon's relationship, as well as Theseus and Hippolyta. The love spells that occur are a sort of fantasy and wish fulfillment interlude. So many quotes from the play refer to these different ideas and symbols.
There is even a suggestion that the entire play is a dream, and the setting in fairyland supports this; at the end of the opening prologue, Puck says:
If we shadows have offended,
Think but this,--and all is mended,--
That you have but slumber'd here
While these visions did appear.
This suggests that the action to come may be a dreamlike experience, and not a "real" story. Later on, Theseus uses the term "shadows" to refer to the players in the production of Pyramus and Thisbe:
The best in this kind are but shadows; and the worst are no worse, if imagination amend them.
The metaphor of "shadows" is another reference to dreaming, to things that look differently at night than during the day. The "midsummer" of the title refers to the summer solstice, which is the shortest night of the year, and this underscores the fleeting quality of the dreams portrayed in the play, and the fact that dreams are often the source of humor and frivolity. This includes "Bottom's Dream" which is created for Titania by Oberon, and results in Bottom being turned into an ass, and Titania being affected by Puck's love spell, so that she falls in love with him even though he looks like an animal.
We also see the lovers using dreams as a way to describe love's fragility. Lysander tells Hermia that love can be be "swift as a shadow, brief as any dream." And after Bottom is released from the spell that turns him into an ass, he says: "I have had a dream, past the wit of man to say what dream it was."