Pontius Pilate was the Roman prefect of Judea.
Prefects in the provinces operated under considerable pressure. Their job was to keep order, collect taxes, and prevent uprisings. A riot or rebellion on their watch was a career-ending and sometimes life-ending event.
Public sentencing in the Roman world was a civic spectacle, conducted before a crowd with a genuine stake in the outcome. The crowd had political weight, and competent prefects knew it and acted accordingly.
This is the context in which Pontius Pilate sentences Jesus. He is a Roman official reading a volatile room and calculating his options. The crowd gathered before him had real leverage and he knew exactly what was at stake.
John tells us that Pilate found no basis for a charge against Jesus. He says so three times. And then he hands him over anyway. What Pilate was doing that morning was not justice. It was self-preservation.