Matthew 27:18

18 For he knew it was out of self-interest that they had handed Jesus over to him.

Read Matthew 27:18 Using Other Translations

For he knew that for envy they had delivered him.
For he knew that it was out of envy that they had delivered him up.
(He knew very well that the religious leaders had arrested Jesus out of envy.)