Puck speaks the final words at the end of the play in an attempt to make amends with the audience and apologize for the fairies' behavior during the performance. He asks that, "If we shadows have offended, / think but this, and all is mended, / that you have but slumb'red here / While these visions did appear. / And this weak and idle theme, / No more yielding but a dream, / Gentles, do not reprehend. / If you pardon, we will mend." Finally, he says, "So, good night unto you all. / Give me your hands, if we be friends, / And Robin shall restore amends."
Shakespearean comedies always end with a restoration of human relationships, and in this case the restoration includes the play's audience. Puck makes it clear that the fairies' mischief was not intended to cause harm, and that all will be set aright.
An epilogue is a speech and it almost like a PS (postscript) to the main body of, in this case a play. It can serve to bring closure to events or answer questions which may still confuse the audience. In A Midsummer Night's Dream, it actually invites questions and may have the audience wondering what they have just witnessed. In the play, everyone is content and natural order has been restored. The marriages satisfy the Elizabethan norm of creating harmony and resolving conflicts and the audience can go home content.
Puck is the mischievous sprite who caused all the confusion in the first place and who relishes the effects of his creation. In delivering this epilogue, Puck adds an unexpected element to the play and he invites the audience to consider that they have participated in this dream-like scenario as they have "slumbered here" (V.i.415). He wants to be sure that the audience has benefited from this flippant but harmless display which he admits has an "idle theme" (416) and that the audience will forgive him if what he caused shows disrespect. He points out that it was never intended to offend and is a means of light entertainment, having no influence and being "no more yielding but a dream" (417). In fact, Puck may even have the audience wondering if perhaps it imagined everything and this skillfully allows him to avoid all blame for having created chaos and, with the blessing of the audience, he "shall restore amends" (427).