Prospero gives Ferdinand his blessing to marry Miranda, saying that Ferdinand has stood up well to Prospero's tests of his love. He threatens harsh consequences, however, if Ferdinand takes Miranda's virginity before an official wedding ceremony takes place. Ferdinand pledges to obey Prospero's wishes.
Ferdinand wins his freedom and love because he faced his loss of power without bitterness. Every character who bears loss in this way in The Tempest is ultimately rewarded.
Prospero orders Ariel to gather his band of spirits to put on a celebratory masque, or performance, for the new couple. The masque begins when Iris, the Greek goddess of the rainbow, calls Ceres, the harvest goddess, to come and join her in celebrating the marriage. Juno, wife of Zeus and queen of the gods, appears next. Juno bestows her blessing on the couple, wishing them wealth and honor, while Ceres blesses them with wishes of prosperity. In awe, Ferdinand wishes he could stay on the island forever, with Miranda as his wife and Prospero as his father. Iris commands nymphs and harvest spirits to perform a country dance.
Prospero has been using his magic to manipulate and control the play's other characters. Now he steps into the role of playwright and "writes" the masque. In the process, he displays his full power, so amazing and humbling Ferdinand that the boy is now in awe of his father-in-law.
Suddenly, Prospero recalls Caliban, Stephano, and Trinculo's conspiracy to kill him. He calls an abrupt end to the festivities and the spirits vanish. Ferdinand is unsettled by Prospero's change in demeanor. Prospero reassures him, saying that an end must come to all things: "We are such stuff as dreams are made on; and our little life is rounded with a sleep" (4.1.156–158). He instructs the lovers to go and rest in his cave without telling them any more details of what is going on.
At this moment, Prospero almost seems to lose control. It's as if he got so caught up in his "art" that he lost track of real life (which is also what led to Prospero's fall in Milan). Though Prospero's speech can be seen as a meditation on age and mortality, many critics believe that it refers to the impermanence of Shakespeare's own craft and legacy.
Prospero summons Ariel, who reports that he has led the drunken conspirators on a torturous walk through briar patches and a stinking swamp. He describes their plot to steal Prospero's cloak and books before killing him. Prospero curses Caliban, calling him "a born devil, on whose nature nurture can never stick" (4.1.188–189).
Prospero and Ariel set a trap for the conspirators: they set out some flashy opulent clothing on a clothesline near Prospero's dwelling. Then they stand back and watch as the wet threesome approaches.
Prospero plays a psychological game designed to humiliate his enemies and expose their greed and superficiality.
Stephano and Trinculo complain about the smell and the loss of their wine in the swamp. Caliban tries to re-focus them on the murder. He points out Prospero's cave close by and reminds them of the ultimate reward, saying "Do that good mischief which may make this island thine own for ever, and I...for aye thy foot-licker" (4.1.216–218). But to Caliban's dismay, Stephano and Trinculo notice the gaudy clothing and are distracted. They begin to try it on and make plans to steal it. Caliban becomes increasingly anxious, watching his plan unravel.
Just as Antonio wanted more to look like a duke than to be a duke, and traded the power that Prospero gave him for the title of duke and subservience to Alonso, Stephano and Trinculo would rather look like rulers than be rulers, and so they focus on the fancy clothes rather than the plot against Prospero.
Ariel and Prospero send spirits shaped like hunting dogs to chase off the conspirators. Prospero orders Ariel to make sure that the dogs inflict pain and suffering on the threesome: "grind their joints with dry convulsions, shorten up their sinews with aged cramps" (4.1.252–254).
Prosper's anger toward the conspirators is fierce. Caliban seems to inspire a particularly strong rage in him, perhaps because, unlike the other characters, he's never able to subdue Caliban completely.
Prospero says that all of his enemies are now under his control, and he promises Ariel that he will soon have his freedom.
This final line sets the stage for Prospero's confrontation with his enemies and the restoration of peace.