Hearing that the church in Judea needed financial assistance, the church in Antioch sent them a gift by the hands of Saul and Barnabas. While the two men were traveling to Jerusalem, Herod decided to attack the church in order to please the apostate Jews. He had James the brother of John put to death. Then he arrested Peter and planned to put him on trial after Passover (probably so that he would not be released at Passover; Matthew 27:15–21).
We read that the church prayed earnestly for Peter. Doubtless they prayed for James as well, but probably after seeing James put to death, they prayed more earnestly for Peter. The point is not that if they had prayed more earnestly for James, God would have released him. Rather, the point is that God answered their prayers for James with a "no," while answering their prayers for Peter with "yes."
An angel appeared and released Peter, who went to the place where the church was meeting. Meanwhile, Herod put to death the guards who were supposed to watch him (Acts 12:6–19). The church's prayer for Peter's salvation had a double effect. As in the Psalms, deliverance for God's people means destruction for their enemies. Thus, right after we read about Peter's deliverance we read about Herod's death.
Herod went down to Caesarea. According to the Jewish historian Josephus, he was celebrating a festival in honor of the current Caesar, Claudius (Antiquities 19:8:2). During this time, vassals from Tyre and Sidon sought an audience with Herod. On the appointed day, Herod wore a special royal robe and began to address these people. They cried out that his voice was that of a god, not of a man. Unlike the angels, who always reject worship, Herod accepted it. Immediately God struck him down, and he was eaten by worms and died (Acts 12:19–23). Josephus explains that Herod was struck with horrible stomach pains, and died a few days later.
The next verse says that the "word of God continued to increase and spread." The destruction of God's enemies opened the door of evangelism wider than it had been. The prayer of the church had been effective.
For the Gospel to spread, we must pray for the deliverance of oppressed Christians and the destruction of the enemies of the church. We do not dictate to God how to destroy them. He may destroy them as He did Herod, or He may "destroy" them as He did Saul. Either way, the Great Commission must be carried out.