Prospero's master-servant relationship with the spirit Ariel begins when Prospero releases Ariel from inside a pine tree where Ariel has been imprisoned by "This damned witch Sycorax" (1.2.314) for refusing "To act her earthy and abhorred commands" (1.2.324). Ariel remained inside the tree for twelve years, until Prospero came to the island.
PROSPERO. It was mine art,
When I arrived and heard thee, that made gape
The pine and let thee out. (1.2.343–345)
Prospero angrily reminds Ariel of this fact and calls Ariel a "malignant thing" (1.2.306) and his "slave" (1.2.321) when Ariel asks Prospero to honor a promise he made to Ariel to release him from Prospero's service in one year.
This is the only time in the play that Prospero refers to Arial as "my slave." In this same scene, before Ariel reminds Prospero of his promise, Prospero calls Arial "servant," (1.2.219), "My Ariel," (1.2.221), "My brave spirit" (1.2.241), and "my spirit" (1.2.252), all of which denote servitude to Prospero—which is also reflected in Prospero's use of the possessive "my" when referring to Ariel throughout the play—or even a friendly master-servant relationship; but none of those endearments implies slavery.
It's only when Ariel angers Prospero that Prospero refers to their relationship on a baser level and threatens to imprison Ariel in an oak tree for another twelve years. This might be an idle threat, because Prospero has no powers over nature, even though he claims that he released Ariel from inside the tree with his "art" (1.2.343), but it's a threat that's sufficient to keep Ariel subservient to him.
Prospero has no reason to doubt Ariel's loyalty to him. Ariel never refuses to do what Prospero asks him to do, "be't to fly / To swim, to dive into the fire, to ride / On the curled clouds," (1.2.223-225), or to cause the raging tempest at sea that opens the play. Ariel always performs his tasks to the letter, and Prospero invariably takes credit for Ariel's work.
For example, Prospero implies to his daughter, Miranda, that he caused the tempest and takes credit for it, but, in fact, Ariel did it all, all by himself.
PROSPERO. Hast thou, spirit,
Performed to point the tempest that I bade thee?
ARIEL. To every article. (1.2.227–229)
It's important for Prospero to reinforce his domination over Ariel and perhaps even to claim ownership of Ariel because Prospero needs Ariel. Ariel has skills that Prospero needs to implement his magic—if, indeed, Prospero actually has any powers of his own—and Ariel has powers, particularly powers over the natural world, that Prospero needs but doesn't possess.
Prospero exerts his possession and control of Ariel throughout the play, even after Prospero divests himself of his own magical powers, because Prospero has need of Ariel for one more task. Prospero promises Alonso, King of Naples, and the others with whom Prospero is returning to Naples, that he, Prospero himself, will deliver "calm seas, auspicious gales" (5.1.365).
Prospero then immediately turns to Ariel to have Ariel deliver on Prospero's promise to ensure his ship's safe passage to Naples—for which Prospero will no doubt take full credit—after which Ariel will be free.
PROSPERO. My Ariel, chick,
That is thy charge. Then to the elements
Be free, and fare thou well! (5.1.367–369)
This is when Prospero finally grants Ariel his freedom: Prospero no longer needs Ariel, or Ariel's powers, to do his bidding.