The Midrash tells about a ship that arrived at an inhabited island. They asked the only Yid aboard to disembark and to bring back fresh provisions for the passengers. The Yid asked, "Why do you send specifically me? I’m a stranger on this island, just like you. No one knows me here. I will be all alone there..." The captain told him, "A Yid is never alone. As it states, אליו קראנו בכל אלקינו 'כה, When you call to Hashem, Hashem is near you, and He will help you."
The Miracle Came from Tefillah
The Rambam (end of המצוות מנין) writes: "The prophets with the beis din established and commanded that we read the megillah at its designated time to remember Hakadosh Baruch Hu's praises and the salvation He performed for us, and that He was near to listen to our shouts, so we will bless Him and praise Him and to let the upcoming generations know that what the Torah says is true [that Hashem listens to our tefillos]. As it states (Devarim 4:7), אלוקים לו אשר גדול גוי ומי אליו קראנו בכל אלקינו 'כה אליו קרובים , 'Which great nation has a god as close to them like Hashem our G-d Who is close to us whenever we pray to Him."
The Purim miracle came about through tefillos. The Midrash (Esther Rabba 7:13) states, "When Haman plotted to destroy the Jewish nation, Eliyah HaNavi z'l ran, in a בהלה, confusion, to the avos (Avraham, Yitzchak, and Yaakov) and Moshe Rabbeinu and he said, 'Holy forefathers! For how long will you sleep in your graves? Why aren't you paying attention to the tzarah the Yidden are in? The malachim, the sun, moon, and the stars are all crying bitterly, and you remain distant and do not pay attention.'
"The avos asked, 'What is the reason for this decree?'
"Eliyahu replied, 'Bnei Yisroel ate at Achashveirosh's party, and it was therefore decreed that they will be destroyed and that their memory be erased forever.'
"The avos replied, 'If they transgressed Hakadosh Baruch Hu's laws and, therefore, the decree was signed, what can we do about it?'
"Eliyahu returned to Moshe Rabbeinu and said, 'Devoted shepherd of Bnei Yisrael. Many times, the Jewish people's lives were in danger, and you prayed for them. You annulled the decree, and the nation was spared. [Now, once again, daven for the Jewish people.]'
"Moshe replied, 'Is there a tzaddik in the generation?'
"Eliyahu replied, 'There is. His name is Mordechai.'
"Moshe said, 'Tell him about the decree. He will daven that the decree should be annulled from the earth, and you and I will daven before Hakadosh Baruch Hu in heaven.'
"Eliyahu said, 'But the decree has already been written.'
"Moshe said, 'If the decree was sealed with clay, our tefillos could be effective. If the decree was sealed in blood, what will be will be.'
"Eliyahu replied that the decree was signed in clay."
Moshe repeated, 'Tell Mordechai about the decree.'
"Eliyahu went to Mordechai and told him. As it states (Esther 4:1) אשר כל את ידע ומרדכי בגדיו את מרדכי ויקרע נעשה , 'Mordechai knew everything that happened, and Mordechai ripped his clothing.'..." He knew about the decree because Eliyahu told him about it.