After Jesus had finished praying in the garden at Gethsemane he was betrayed into the hands of the authorities. Judas came with a crowd who were armed to the teeth with swords and clubs to seize him. The sign Judas gave that was to betray Jesus was that he would kiss him.
The time had come when all the prophecies of old to be fulfilled. Jesus knew this and that there was no other way for it to occur than had been already pre-ordained. One of his disciples though was prepared to stand and fight for the sake of Jesus. In another version of this even we see that it was Peter who took the sword and struck Malchus who was the slave of the High Priest and cut off his ear. (John 18:10) We also see in the Luke version that Jesus told his disciples not to resist the mob. And after cutting off the ear of Malchus, Jesus said, “No more of this!” He then touched and healed the slave’s injured ear. (Luke 22:49-51)
So even in this darkest hour and against his captors we see Jesus show compassion and love towards those who would do him harm. He certainly could have escaped if it was the will of the Father. As Jesus said, he could have appealed to the Father and received the help of more than twelve legions of angels, that is, more than sixty to seventy thousand angels. But as he said, if he were to do so how would the prophecies be fulfilled? How would the New Covenant come into being for it could only be ratified by the sacrifice of perfect blood? That could only be achieved by the death and resurrection of Jesus.
At the end of this section we see also that Jesus words came true when all of the disciples fled and forsook him. Their bravado from earlier sections where they said they would stand with Jesus even if it meant death came to nothing in the end. But this was to fulfil prophecy and had to happen. If they had stood their ground and been put to death too, then who would preach the gospel to the world? It was actually necessary that they take flight to preserve themselves so that in due course they would be able to take the gospel of Christ to the world. At Pentecost when the disciples received the Holy Spirit and power, we see a dramatic change of heart. From the men who fled from the crowd who took Jesus captive, they became bold and strong, standing and preaching the word of truth in the face of great opposition. And the people listened to them and many came to Christ.
All of this could not take place unless and until Jesus had been thus betrayed and put to death. The power that was to come through receiving the Holy Spirit could not come unless Jesus first died and opened the way for man to stand before God under the New Covenant. His betrayal, which seemed to be the end and a victory for the powers of that day, turned out to be their great loss and our great gain. What seemed to be a failure in the death of the Lord was in fact the greatest victory of all. For this victory of Jesus was a victory over sin and death and through his victory we received the ability to enter into that victory and be saved.