4 But when he says, “The devil having now put into the heart of Judas Iscariot, Simon's son, to betray Him;” if one inquires, what was put into Judas' heart, it was doubtless this, “to betray Him.” Such a putting [into the heart] is a spiritual suggestion: and enters not by the ear, but through the thoughts; and thereby not in a way that is corporal, but spiritual. For what we call spiritual is not always to be understood in a commendatory way. The apostle knew of certain spiritual things [powers], of wickedness in heavenly places, against which he testifies that we have to maintain a struggle; and there would not be spiritual wickednesses, were there not also wicked spirits. For it is from a spiritual being that spiritual things get their name. But how such things are done, as that devilish suggestions should be introduced, and so mingle with human thoughts that a man accounts them his own, how can he know? Nor can we doubt that good suggestions are likewise made by a good spirit in the same unobservable and spiritual way; but it is matter of concern to which of these the human mind yields assent, either as deservedly left without, or graciously aided by, the divine assistance. The determination, therefore, had now been come to in Judas' heart by the instigation of the devil, that the disciple should betray the Master, whom he had not learned to know as his God. In such a state had he now come to their social meal, a spy on the Shepherd, a plotter against the Redeemer, a seller of the Saviour; as such was he now come, was he now seen and endured, and thought himself undiscovered: for he was deceived about Him whom he wished to deceive. But He, who had already scanned the inward state of that very heart, was knowingly making use of one who knew it not.
5. “[Jesus] knowing that the Father has given all things into His hands.” And therefore also the traitor himself: for if He had him not in His hands, He certainly could not use him as He wished. Accordingly, the traitor had been already betrayed to Him whom he sought to betray; and he carried out his evil purpose in betraying Him in such a way, that good he knew not of was the issue in regard to Him who was betrayed. For the Lord knew what He was doing for His friends, and patiently made use of His enemies: and thus had the Father given all things into His hands, both the evil for present use, and the good for the final issue. “Knowing also that He has come from God, and is going to God:” neither quitting God when He came from Him, nor us when He returned.
Source: Tractates on the Gospel of John (New Advent)