At the opening of Shakespeare's The Tempest, a resentful, vengeful, and vindictive Prospero causes a tremendous storm that wrecks the ship on which his brother, Antonio, and others who participated in usurping Prospero's position as Duke of Milan are travelling. All of the passengers on the ship are cast ashore on Prospero's island.
The fact that Prospero doesn't have his brother and the others killed outright in the shipwreck for the wrongs they've done against him provides a glimpse into Prospero's essential character. This spark of humanity in Prospero's character allows him to undergo a gradual change of attitude and change of heart toward his captives; his daughter, Miranda; his slaves, Ariel and Caliban; and even himself.
Prospero's desire for revenge against Antonio, and against those who helped Antonio usurp his dukedom and cast Prospero and Miranda adrift at sea, is tempered by Prospero's need to have Antonio and the others realize the effect of their wrongs against him and repent for the pain they've caused him and Miranda.
In the course of trying to teach them a lesson, Prospero learns the lesson himself. Prospero empathizes with the grief he's caused Alonso, the king of Naples, who believes his son Frederick was drowned in the shipwreck.
Frederick is alive and has fallen in love with Miranda. Prospero at first mistreats Frederick but comes to realize, and to regret, the effect that his mistreatment of Frederick has on Miranda.
Prospero learns to look at his daughter not just as his daughter and a reflection of himself and everything he's taught her in the twelve years they've lived on the island, but as a person in her own right.
Prospero becomes aware of Ariel's intense desire for freedom and relates this to his own desire to be free from his need to control every aspect of his and Miranda's lives and to control the fate of everyone shipwrecked on his island.
In act 5, Prospero's changes of mind and heart come to fruition. Prospero forgives Antonio, Alonso, and all of those who wronged him and releases them to return to their own lives. He releases Miranda to marry Frederick, which allows them to build their life together, away from Prospero's control. Prospero frees Ariel and Caliban from their slavery to Prospero's wants and needs.
Prospero also releases himself from his enslavement to his need to control everyone and everything around him and from his need to take revenge on those who took his former life away from him.
Prospero realizes that he no longer needs to be a slave to his magic and to his baser instincts; he can throw off his life on the island and return to civilization. Prospero welcomes the opportunity to return to his old life, as Duke of Milan, in order to start a new life, free of all of those elements of life on the island that held him captive in mind, body, and spirit.
The epilogue of The Tempest serves the same purpose as the epilogue in many of Shakespeare's comedies, such as All's Well That Ends Well, As You Like It, and A Midsummer Night's Dream, and also in a few of his history plays, including Henry IV, Part II; Henry V; and Henry VIII. An epilogue summarizes the play or otherwise brings the play to a close, encourages the audience to applaud the performance, and sends the audience back into the real world in a positive frame of mind.
In the epilogue, Prospero himself speaks directly to the audience. He appeals to the audience to release him from their "spell" and thereby to release him from his magic, from his isolated life on "this bare island," and from his "crimes," so he can return to the real world, to Naples, and to civilization in a positive and uplifted state of mind.