…So the chief priests and the Pharisees convened the Sanhedrin and said, "What are we going to do? This man is performing many signs. If we leave him alone, all will believe in him, and the Romans will come and take away both our land and our nation." But one of them, Caiaphas, who was high priest that year, said to them, "You know nothing, nor do you consider that it is better for you that one man should die instead of the people, so that the whole nation may not perish." He did not say this on his own, but since he was high priest for that year, he prophesied that Jesus was going to die for the nation, and not only for the nation, but also to gather into one the dispersed children of God. So from that day on they planned to kill him… (Jn 11, 45-56)
Jesus’ activities are getting a political colouring. The rulers are worried that because of Jesus the Romans will take over the land and the nation. In fact the Romans had taken over the whole of the Middle East. Only in John’s gospel, the author speaks openly about the Romans (This is the only place where the word ‘Romans’ appears in all four gospels).
The officials were worried that Jesus was gathering a crowd around him. The crowd gathered around him because of his miracles (healing and raising the dead etc) and teachings. Some considered him to be a prophet and others a messiah. Supposing Jesus entered into Jerusalem with this crowd, and if the Romans got the wind of it, then that would be the end of any national hope. That would be the end of the nation. Hence the leaders were worried about the nation.
Hence the plan of Caiaphas could be seen as a prophecy. A prophecy, that says that Jesus would die for the nation. The leaders were plotting a judicial murder to save the nation.
John interprets it as a divine prophecy. He has been saying that Jesus is the ‘lamb of God’, ‘Jesus is the temple to be rebuilt in three days’, ‘Jesus is to be lifted up like a serpent’ etc. So, Jesus dies to gather the scattered children of God.