Then (v 3), our Lord wards off his opponents. First, we see him tested, so that he can then be accused; and secondly, he checks his accusers (v 6b). As to the first, the Evangelist does three things: first, he mentions the occasion for the test; secondly, he describes the test itself (v 4); and thirdly, the purpose of those who were testing our Lord.
The occasion for the test is a woman's adultery. And so first, her accusers detail the crime; and also exhibit the sinner. As to the first, the Evangelist says, Then the scribes and Pharisees brought in a woman caught in adultery. As Augustine sa...ys, three things were noteworthy about Christ: his truth, his gentleness, and his justice. Indeed, it was predicted about him: "Go forth and reign, because of truth, gentleness, and justice" (Ps 44:5). For he set forth the truth as a teacher; and the Pharisees and scribes noticed this while he was teaching: "If I speak the truth, why do you not believe me?" (8:46). Since they could find nothing false in his words or his teachings, they had ceased their accusations on that score. He showed his gentleness as a liberator or savior; and they saw this when he could not be provoked against his enemies and persecutors: "When he was reviled, he did not revile" (1 Pet 2:23). Thus Matthew has: "Learn from me, for I am gentle and humble of heart" (11:29). Thus they did not accuse him on this point. And he exercised justice as its advocate; he did this because it was not yet known among the Jews, especially in legal proceedings. It was on this point that they wanted to test him, to see if he would abandon justice for the sake of mercy. So they present him with a known crime, deserving denunciation, adultery: "Every woman who is a harlot will be walked on like dung on the road" (Sir 9:10). Then they present the sinner in person to further influence him: and placed her in their midst. "This woman will be brought into the assembly, and among the sons of God" (Sir 23:24).
Source: Commentary on John