Most people know that a miracle is needed in order for someone to be decreed, or recognized, as a saint. But why exactly? The miracle actually is needed for two closely related yet distinct reasons. It first confirms that the prospective saint is in heaven, interceding on our behalf with God. The miracle can also be seen as a sign or divine seal of approval in the canonization process—that God himself has stirred the faithful into action. In other words, the miracle confirms the confessor is enjoying the ‘beatific vision’ of God in heaven. Here is how Pope Benedict XVI has put it:
In addition to reassuring us that the servant of God lives in heaven in communion with God, miracles are the divine confirmation of the judgment expressed by church authorities about the virtuous life.
This is what adds a true theological dimension to the process of sainthood. It is what elevates it beyond mere human process in which a person is recognized as holy into one in which heaven itself witnesses to their holiness.
And just what is meant by a miracle?
The Catholic Encyclopedia puts it quite beautifully:
The wonder of the miracle is due to the fact that its cause is hidden, and an effect is expected other than what actually takes place.
There are three such types of miracles—those that are above, those that are contrary to, and those that are beside or outside of nature. Examples for each would include, respectively: a resurrection, which is above anything possible in nature; something contrary to nature would be surviving a fire through supernatural means; and something outside of nature is an instance in which ‘natural forces’ are used to achieve a supernatural effect, such as the multiplication of the loaves, or the healing of a disease. This last type is the one most commonly cited on behalf of a saint. And, in those instances, three requirements are needed to certify that it be a miracle: it must be instant, comprehensive, and long-lasting. And, of course, it must be a healing that cannot be otherwise explained by science.
Note that for saints who were not martyred, at least two miracles are needed in order to confirm their sainthood. For martyrs, from what I have seen, one miracle will suffice.