The Jewish chief priests and their officials falsely accuse Jesus with the purpose of having Him put to death by Pilate, the Roman governor. Immediately before that, the Sanhedrin - the High Council of Judaism- sentenced Jesus to death on charges of His calling Himself the Son of God, or Christ/ Messiah/ King.
Jesus did call Himself Messiah, and He was. But He was King of a Kingdom not of this world. (John 18:36)
The Roman rulers granted the Sanhedrin to impose the death penalty, but did not allow them to carry out the sentence. That’s why the chief priests want Pilate to execute Jesus. At the Roman courthouse they accuse Jesus of calling Himself king of the Jews. They hope Pilate will interpret this title politically, and kill Jesus because He represents a threat to the Roman Empire.
Pilate questions Jesus, and judges Him to be innocent. Nevertheless, he has Jesus flogged.
After the flogging Pilate brings Jesus out and says to the crowd: ‘Here is the man!’ He possibly wants to express: How could a miserable man like this be perilous in any way?
However, Pilate’s words may bring us to consider this Man with our spiritual eyes:
But he was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was on him, and by his wounds we are healed. Isa 53:5.
See also: Psalm 22:7,12 Psalm 27:12 Psalm 35:11,12 Psalm 41:5-9 Psalm 109:1-6.