In act 1, scene 2 of Shakespeare's The Tempest, Prospero assures his daughter, Miranda, that "I have done nothing but in care of thee" (1.2.19). On one hand, this is true. On the other hand, Prospero seems never to do anything without an ulterior motive, even those things that he does out of love for Miranda.
Prospero has controlled Miranda's education and intellectual development and shielded her from care and worry. Prospero can put Miranda to sleep when he needs to conduct business with Ariel, then wake her at will when his business is concluded.
Prospero's magic powers ensure that there's order on the island, which provided a safe and stable living environment for Miranda for the past twelve years, and benefit Prospero, the spirit Ariel, and the grotesque Caliban as well.
Prospero uses magic to control Caliban, who's a threat to Miranda and who has already tried to molest her. For that offense, Prospero confines Caliban to a small, rocky part of the island which he can leave only to do chores and other things that Prospero commands.
Prospero released Ariel from inside a pine tree where Caliban's mother, Sycorax, imprisoned him, but Prospero then enslaved Ariel to do his magical bidding around the island. Prospero periodically threatens to return Ariel to his arboreal prison if he fails to obey Prospero's orders.
When the ship carrying Prospero's brother, Antonio, as well as Alonso, the King of Naples, and others who helped Antonio to usurp Prospero's dukedom comes near Prospero's island, he uses his magic, along with Ariel's assistance, to shipwreck the passengers and strand them on his island.
Shipwrecked with Alonso is his son, Ferdinand, a potential husband for Miranda, but Prospero has ulterior motives for bringing Ferdinand to the island—to facilitate the return of his dukedom—and uses his magic to subjugate and demean Ferdinand until he can prove his love for Miranda.
With his dukedom restored, however, and Miranda planning to be married on their return to Naples, Prospero vows to give up his magic powers, set Ariel and Caliban free, relinquish his control over those he shipwrecked on his island, and pardon all of those who wronged him, including Antonio and Alonso.
PROSPERO. But this rough magic
I here abjure...I'll break my staff,
Bury it certain fathoms in the earth,
And deeper than did ever plummet sound
I'll drown my book (220.127.116.11).