The ancient Roman empire had a loose state policy of allowing the nations they conquered and turned into provinces of Rome to govern their own religious and cultural observances as long as they did not cross the line of any religious laws of Rome. There was a loose "reilgio licita" allowed the Jews for their religious beliefs. (1)
Stoning Steven was a decision by the council (Sanhedrin) because of blasphemy, a religious charge under the control of the Jewish council. But, killing Stephen was not going to endanger their influence over the people. Contrast that with their fear of the people's reaction if they had put Jesus (Yeshua) to death for that charge.
In the blasphemy charge the council leveled against Christ, they agreed among themselves that they feared the people's reaction.
"45 And when the chief priests and Pharisees had heard his parables, they perceived that he spake of them. 46 But when they sought to lay hands on him, they feared the multitude, because they took him for a prophet." (Matt. 21:45-46, KJV)
"3 Then assembled together the chief priests, and the scribes, and the elders of the people, unto the palace of the high priest, who was called Caiaphas, 4 And consulted that they might take Jesus by subtilty, and kill him. 5 But they said, Not on the feast day, lest there be an uproar among the people." (Matt. 26:3-5, KJV)
See also Mark 12:12; and Luke 20:19, 22:2.
So, even though Caiaphas accused Christ of blasphemy (Matt. 26:65), they framed Christ for treason and sedition against the state of Rome presenting Him to Pilate with the charge that Christ was calling Himself KING of the Jews. Instead of a charge of blasphemy against YHWH, which Pilate would have turned back to them to handle, the charge put Christ in a political contest with Caesar, the supreme ruler of Rome.
This allowed the Sanhedrin to pretend their hands were not bloody in the crucifixion of Christ. Thus, framed as a political issue, their claim in John 18:31 was that anything outside of their religious beliefs that impacted Roman law meant they did not have authority to carry out Roman punishment. They had to turn Christ over to Pilate for that.
The Sanhedrin could then turn to their people and say that they did not kill Him, the Romans did. And, we still hear that claim today.
Note
1) Caesar's Jewish Policy... here