Ariel’s message as the harpy reminds the men of their part in taking Prospero’s kingdom from him.
Ariel keeps the men in place during his speech through magic, so the literal answer is that Ariel and Prospero have been keeping Alonso, Antonio, and the others under a spell since they landed on the island. However, the message is also designed to prey on their guilt. If they are good men at all, they will feel remorse for what they have done. They had no idea that Prospero was on the island, or even that he was still alive. When they find out, it has a great effect on them.
Alonso and Antonio are most at fault because they conspired to take Prospero’s kingdom from him and set him adrift in a broken down boat with nothing but his baby daughter. Gonzalo secretly assisted Prospero, so he is considered a friend and a good person. It is clear from the conversation that Sebastian and Antonio have that they are not good men. Always scheming, they are ready to kill Alonso to take his place as king.
Prospero sees the presence of his greatest enemies all in one place on his island as a grand opportunity for revenge. Ariel comes to the men in the guise of a harpy, a mythological bird woman, and tells them they are “men of sin.” He is actually referring to Alonso, Antonio, and Sebastian only.
Lingering perdition, worse than any death
Can be at once, shall step by step attend
You and your ways; whose wraths to guard you from--
Which here, in this most desolate isle, else falls
Upon your heads--is nothing but heart-sorrow
And a clear life ensuing. (Act 3, Scene 3)
After the visit from the harpy, which had the men entranced, Prospero is not done with them. He tells Ariel that they will remain under his control until he can deal with them properly.
My high charms work
And these mine enemies are all knit up
In their distractions; they now are in my power;
And in these fits I leave them … (Act 3, Scene 3)
Interestingly enough, Prospero has become somewhat of a changed man too. He wanted to draw Ferdinand in to fall in love with his daughter, and the match was a successful one. Prospero is happy for them. It is not just a ploy to get back at his enemies. He decides to put down his book of magic and reclaim his throne, but without seeking any further revenge against the men who took it from him in the first place.
In an unusual moment of forgiveness, Prospero brings the men to him and tells them that he is still alive, but he does not kill them or perform some other kind of magical punishment on them. He turns the occasion into a happy one, bringing the rest of the crew together and showing Alonso his son. Even betrayed by his brother and isolated in years of frustration and anger, Prospero is able to forgive.