"Peter was therefore kept in prison, but constant prayer was offered to God for him by the church. And when Herod was about to bring him out, that night Peter was sleeping, bound with two chains between two soldiers; and the guards before the door were keeping the prison. Now behold, an angel of the Lord stood by him, and a light shone in the prison; and he struck Peter on the side and raised him up, saying, 'Arise quickly!' And his chains fell off his hands. Then the angel said to him, 'Gird yourself and tie on your sandals'; and so he did. And he said to him, 'Put on your garment and follow me. So he went out and followed him, and did not know that what was done by the angel was real, but thought he was seeing a vision. When they were past the first and the second guard posts, they came to the iron gate that leads to the city, which opened to them of its own accord; and they went out and went down one street, and immediately the angel departed from him" (Acts 12:5-10).
Peter was imprisoned and the Christians knew his life was in danger, so they prayed for him intensely and continually (cf. I Thess. 5:17). Herod had already killed James and was likely about to do the same to Peter. Losing another apostle would have been a terrible blow to the church, and these disciples petitioned God over and over again. They chose prayer instead of violence to rescue Peter. The night before Herod was going to act against Peter, the apostle was miraculously freed from prison. Peter was sleeping soundly, which is evidence of the fact that he had no fear of death. However, he was not in a cell by himself but chained between two soldiers! This was not a common practice for all inmates but was understandable for Peter who was perceived as an escape risk (e.g., Acts 5:19ff). In addition to being chained between two soldiers, there were two other men guarding the door. So, even if Peter somehow managed to overpower the two soldiers and free himself from the chains, he would still have to contend with the prison door and two more guards (not to mention the outer guard posts). Clearly, Peter was being well guarded, but it was all in vain against the wisdom and power of God!
It was God's will that Peter be freed that night, and there was no conceivable number of guards, chains, or locked gates and doors that could have prevented it! Things do not always work out the way men plan (no matter how good the plan seems), as Herod would learn the next morning! Although we cannot know for certain either way, one might wonder: "Would God have delivered Peter had the passionate prayers of the saints not been offered up on his behalf? Was it their petitions that directly resulted in his life being spared?" Regardless of the answer, we should pour out our requests in prayer to Almighty God without failing to yearn for His will to be done (cf. James 5:16; I John 3:22; 5:14; e.g., Matt. 26:36ff).
Luke records the details of the miraculous escape. An angel from God woke Peter up by lightly striking him on the side. His chains fell off as he rose to his feet. The two guards chained to him were evidently also asleep and not disturbed as he put on his sandals and got dressed. Peter believed he was seeing a vision as he followed the angel safely out of the prison and past the guard posts undetected. As soon as Peter was safe inside the city (after passing through a secure iron gate that opened on its own), the angel departed and the apostle was left in a somewhat confused state trying to figure out what had transpired.
"And when Peter had come to himself, he said, 'Now I know for certain that the Lord has sent His angel, and has delivered me from the hand of Herod and from all the expectation of the Jewish people.' So, when he had considered this, he came to the house of Mary, the mother of John whose surname was Mark, where many were gathered together praying" (Acts 12:11,12).