Then is added concerning the other Elijah: but I say to you that Elijah has already come. Who is he? John the Baptist, not that he is the same in person, as is found in John 1:21, when it was asked of him, are you Elijah? He answered: no. But in spirit and power: because just as Elijah will be the precursor of the second coming, so John was of the first coming. Likewise, just as Elijah opposed Jezebel, so John opposed Herodias; and just as Elijah was a dweller of the desert, so was John. Hence it is said of him in Luke 1:7: he shall go before him in the spirit and power of Elijah. In spirit: n...ot because the spirit of Elijah passes into John, as some have held, but he will have the same power. And they knew him not, i.e., they did not approve of him, as is found below at 21:25, where the Lord asked whether the baptism of John is from heaven or from earth, because, if they had said from heaven, they would have had to believe. But they did to him whatever they wished, because they treated him badly, not according to what justice required, but they imprisoned him. A similar case is found concerning Jeremiah in Sirach 49:9: for they treated him badly, who from his mother's womb was consecrated a prophet. So also shall the Son of man suffer from them. John was the precursor of Christ with regard to his birth, because just as John was born of an old and barren woman above nature, so Christ was born of a virgin above nature. Likewise in preaching, because he began to preach, do penance, and so did Christ. Likewise with regard to baptism; therefore it was required that he should be a precursor with regard to his passion, because just as he was killed on account of justice, so also was Christ. Hence so also shall the Son of man suffer from them. But from which them? It seems not from the same ones as John, because John suffered from Herod, and Christ from the Scribes. But it can be said that from the same, because John suffered from Herod with the Jews consenting, but Christ from the Scribes with Herod consenting. Hence he was in those parts, and was presented to him; Psalm 2:2: the kings of the earth stood up, and the princes met together against the Lord and against his Christ. Or so shall he suffer from them, such that the word them makes a simple reference, because all are in one generation, from whom John and Christ suffered.
Source: Commentary on Matthew