Neither Ariel nor Caliban are free as the play opens, though both long for freedom. At the play's end, Prospero frees Ariel for all his good services. Finally, at the end of the play, Prospero also, in a burst of generosity, forgives Caliban.
Prospero, though initially bent on revenge against the men who stole his kingdom and set he and Miranda adrift on a leaky vessel to die, practices forgiveness at the end of the play. In this he is inspired by Ariel, who feels compassion for Prospero's suffering enemies. Prospero is moved by Ariel's empathy:
Hast thou, which art but air, a touch, a feeling
Of their afflictions, and shall not myself,
One of their kind, that relish all as sharply
Passion as they, be kindlier moved than thou art?
As Prospero says, if a spirit, which is merely air, can be touched by the suffering of humans, how can he, himself a human, not be as kind or kinder? Forgiveness, then, works by example: as we show compassion and forgiveness, we encourage these qualities in others.
Prospero forgives even though some of the forgiven are unrepentant and don't deserve his mercy. Shakespeare is saying that the act of forgiveness is more important to the forgiver than to those forgiven. In forgiving his enemies, rather than crushing them when he has them in his power, Prospero finally achieves the peace that had eluded him for many years. Forgiveness heals him.
Given that the question is about forgiveness and freedom, it is natural to ponder the link between the two. Forgiveness, Shakespeare, seems to be arguing, brings freedom. We as an audience also feel a sense of lightness and are lifted at this generous ending. We too feel freed from the oppressive need for revenge. Forgiveness and freeing others feels good. If, as many critics contend, Prospero is Shakespeare saying goodbye to the stage, perhaps Shakespeare too achieved a sense of freedom in forgiving enemies he could have destroyed.