Shakespeare's A Midsummer Night's Dream is not only 2 plays in one, but it also contains a play within a play. The story is fanciful and romantic, and the two plotlines overlap, drawn together by the presence of the faeries and their interference in human affairs. Puck is one of the chief links between the two plotlines: one involving the runaway couples Demetrius and Helena and Lysander and Hermia, who spend the night in the enchanted forest and Bottom and the players, who come to the forest, though Bottom is the only one who spends the night there. Puck's mischief at the behest of Oberon drives the play to its conclusion. Puck's spirit premeates the play, giving it a sense of whimsy and the feeling that anything can happen.
Puck's humor differs from Bottom's in several distinct ways, one of which is the fact that, as a faerie, Puck can play tricks on humans. Bottom IS human, so he becomes the butt of a joke, but his own sense of humor makes the situation seem more lighthearted than it could be. Bottom is a self-absorbed character, but he is an innocent. He thinks he is a great actor and does not know when people are making fun of him, which is one of the things that make his scenes so funny.
This culminates in the ridiculous play within a play in the last act. Shakespeare likes to emphasize the fact that his audiences are watching a play and how our lives resemble action on a stage. In this case, he gives us a happy ending and a reassurance from Puck that it is all a dream.