It is in Act I scene 2 that Prospero tells Miranda about the curious series of events that led them to come to the island which Miranda now thinks of as her home. This scene also fulfills the function of telling us, the audience, about their background and the conflict that exists between Prospero and the guests he has arranged to visit him on the island.
He tells Miranda that before they came to the island, he was Duke of Milan and "a prince of power." When he was overthrown from his position of power, he was saved by his people who loved him and did not want to become involved in a violent overthrow. Note what he tells Miranda about what they did:
In few, they hurried us aboard a bark,
Bore us some leagues to sea; where they prepared
A rotten carcass of a butt, not rigged,
Nor tackle, sail, nor mast: the very rats
Instinctively have quit it. There they hoist us,
To cry to the sea, that roared to us; to sigh
To the winds, whos epity, sighing back again,
Did us but loving wrong.
Therefore we can see that Prospero and Miranda managed to escape being killed on a boat prepared for them by Prospero's people. In addition, he tells Miranda that Gonzalo made sure that they had water, food and cothing, and also the books that Prospero loved so much. From there they sailed out and managed to arrive at the island which is now their home.