Luke related this incident as though God was orchestrating Peter"s release (cf. Acts 5:18-20; Acts 16:23-29). There is no reason to take the account as anything less than this. Once outside the prison and left alone by his angelic guide Peter realized that his release was genuine. God did here for Peter what He had done for the Israelites in leading them out of their Egyptian prison in the Exodus. God"s enemies can never frustrate His plans ( Matthew 16:18). [source][source][source]
Why did God allow Herod to kill James but not Peter?[source]
"The answer is that this is the sovereign will of God. He still moves like this in the contemporary church. I have been in the ministry for many years, and I have seen the Lord reach in and take certain wonderful members out of the church by death. And then there are others whom He has left. Why would He do that? If He had asked me, from my viewpoint as the pastor, I would say that He took the wrong one and He left the wrong one! But life and death are in the hands of a sovereign God.... This is His universe, not ours. It is God"s church, not ours. The hand of a sovereign God moves in the church." [1][source]