What holds Acts 12 together is as much Herod as it is the mission of God — in fact, the chp is about God’s mission in spite of Herod Agrippa I. Herod’s a creep, a brutal despot who puts people to death for gospeling and then puts people to death even when God liberates people — he is blind to what God is doing, as many despots are. (Perhaps I should say “all” despots are blind to the mission of God.) Again, for details see: The Acts of the Apostles (Abingdon New Testament Commentaries)
.
Notice what happens here:
Acts 12:18 In the morning, there was no small commotion among the soldiers as to what had become of Peter. 19 After Herod had a thorough search made for him and did not find him, he cross-examined the guards and ordered that they be executed.
Then Herod went from Judea to Caesarea and stayed there. 20 He had been quarreling with the people of Tyre and Sidon; they now joined together and sought an audience with him. Having secured the support of Blastus, a trusted personal servant of the king, they asked for peace, because they depended on the king’s country for their food supply.
Acts 12:21 On the appointed day Herod, wearing his royal robes, sat on his throne and delivered a public address to the people. 22 They shouted, “This is the voice of a god, not of a mere mortal.” 23 Immediately, because Herod did not give praise to God, an angel of the Lord struck him down, and he was eaten by worms and died.
The guards are held accountable for not securing the prison, though the reader of Acts knows that guards can’t resist God. This shows Herod’s power and authority; it shows Herod’s resistance and blindness to what God is doing.
Herod then leaves Jerusalem and goes to Caesarea. The folks in Tyre and Sidon had been in conflict with Herod over food supply and sought his audience, and they got it through a friend — patronage systems ruled the world at that time (and still does all over the place).
To congratulate himself on his own power, Herod holds an audience in his royal attire and the the people say “This is the voice of a god, not of a mere mortal.” Herod took it in and, because he did not attribute his power to God, his life is taken — much as is Anannias’ and Sapphira’s.
You might like this account of the same death from Josephus, Antiquities 19 (343-352 [19.8.2]):
Now when Agrippa had reigned three years over all Judea, he came to the city Cesarea, which was formerly called Strato’s Tower; and there he exhibited shows in honor of Caesar, upon his being informed that there was a certain festival celebrated to make vows for his safety. At which festival a great multitude was gotten together of the principal persons, and such as were of dignity through his province. On the second day of which shows he put on a garment made wholly of silver, and of a contexture truly wonderful, and came into the theater early in the morning; at which time the silver of his garment being illuminated by the fresh reflection of the sun’s rays upon it, shone out after a surprising manner, and was so resplendent as to spread a horror over those that looked intently upon him; and presently his flatterers cried out, one from one place, and another from another, (though not for his good,) that he was a god; and they added, “Be thou merciful to us; for although we have hitherto reverenced thee only as a man, yet shall we henceforth own thee as superior to mortal nature.” Upon this the king did neither rebuke them, nor reject their impious flattery. But as he presently afterward looked up, he saw an owl sitting on a certain rope over his head, and immediately understood that this bird was the messenger of ill tidings, as it had once been the messenger of good tidings to him; and fell into the deepest sorrow. A severe pain also arose in his belly, and began in a most violent manner. He therefore looked upon his friends, and said, “I, whom you call a god, am commanded presently to depart this life; while Providence thus reproves the lying words you just now said to me; and I, who was by you called immortal, am immediately to be hurried away by death. But I am bound to accept of what Providence allots, as it pleases God; for we have by no means lived ill, but in a splendid and happy manner.” When he said this, his pain was become violent. Accordingly he was carried into the palace, and the rumor went abroad every where, that he would certainly die in a little time. But the multitude presently sat in sackcloth, with their wives and children, after the law of their country, and besought God for the king’s recovery. All places were also full of mourning and lamentation. Now the king rested in a high chamber, and as he saw them below lying prostrate on the ground, he could not himself forbear weeping. And when he had been quite worn out by the pain in his belly for five days, he departed this life, being in the fifty-fourth year of his age, and in the seventh year of his reign; for he reigned four years under Caius Caesar, three of them were over Philip’s tetrarchy only, and on the fourth he had that of Herod added to it; and he reigned, besides those, three years under the reign of Claudius Caesar; in which time he reigned over the forementioned countries, and also had Judea added to them, as well as Samaria and Cesarea. The revenues that he received out of them were very great, no less than twelve millions of drachme.Yet did he borrow great sums from others; for he was so very liberal that his expenses exceeded his incomes, and his generosity was boundless.