Literary critic Northrop Frye points out that the play's title is appropriate because most of the action takes place on the eve of May Day, and in earlier calendars, the month of May was considered midsummer. In addition, the fairies present in the play create a dreamlike state for all the Athenians in the woods that can even be considered somewhat spooky, even nightmarish.
Frye points out that before the Christian calendar was established, only three seasons were recognized, summer, fall, and winter. The summer season actually began in March and included what we now call spring. In addition, fall would actually have begun in August. Hence, according to the pre-Christian calendar, May would certainly be considered midsummer. We know that the play is set from May Day eve through to May Day because, in the morning when the four lovers are found in the forest, Theseus remarks:
No doubt they rose up early to observe
The rite of May; and, hearing our intent,
Came here in grace of our solemnity. (IV.i.132-134)
Hence, we see that the title of the play is appropriate because the action does indeed take place in midsummer.
In addition to May being midsummer, Frye also points out that May Day eve was one night that was considered "haunted," in which spirits were expected to be out and about that could be either "benevolent or malignant" ("Mythological Background"). Therefore, it makes perfect sense that the fairies are in the forest causing mischief that night. The fairies create a dreamlike state through their use of enchantment by creating a reality that is completely different from the true reality. The reality they create stems from having enchanted both Lysander and Demetrius to pursue Helena when in their former reality they were both pursuing Hermia instead. Therefore the fairies created a reality that was completely opposite of the former reality. While this new state of being has certain advantages for Helena, in reality the new state is a bit nightmarish. It is nightmarish for Helena because she cannot bring herself to believe that either man is being sincere. Helena not only believes that both men are mocking her, she also believes that her dearly beloved best friend from childhood is in on the joke, creating a break in their friendship, as we see in Helena's lines:
Lo, she is one of this confederacy!
And will you rent our ancient love asunder,
To join with men in scorning your poor friend? (III.ii.195,218-219)
Not only does Puck's mischief create a nightmarish state of reality for Helena, it especially creates one for Hermia because now suddenly, without any known cause, her true love hates her. However, Puck makes amends and creates yet another dreamlike reality, and this dreamlike reality is what one would think of as the perfect state often found only in dreams. This new dreamlike reality consists of Helena being rightly paired with Demetrius, especially since Demetrius was engaged to Helena before he began pursuing Hermia, and of Hermia being paired with Lysander. We are also given the added dreamlike closure of Theseus' decree to override Egeus's wish to have his daughter executed. Hence, the happy ending that Puck creates is also a dreamlike state consistent with the play's title.