19 And this is the record of John, when the Jews sent priests and Levites from Jerusalem to ask him, Who art thou?
20 And he confessed, and denied not; but confessed, I am not the Christ.
21 And they asked him, What then? Art thou Elias? And he saith, I am not. Art thou that prophet? And he answered, No.
22 Then said they unto him, Who art thou? that we may give an answer to them that sent us. What sayest thou of thyself?
In the other gospels, John the Baptist witnesses to Israel of the coming kingdom. In John, he witnesses to the person of Christ.
The priests and Levites were probably sent by the Sanhedrin — “the Jews”
They wondered if John was the Christ. And as the people were in expectation, and all men mused in their hearts of John, whether he were the Christ, or not (Luke 3:15).
John denied being Elijah because he wasn’t literally (showing his humility). Behold, I will send you Elijah the prophet before the coming of the great and dreadful day of the Lord (Malachi 4:5).
Jesus said John was Elijah because John ministered in the power and spirit of Elijah. And Jesus answered and said unto them, Elias truly shall first come, and restore all things. But I say unto you, That Elias is come already, and they knew him not, but have done unto him whatsoever they listed. Likewise shall also the Son of man suffer of them (Matthew 17:11-12).
Each coming of Christ is preceded by Elijah.
That prophet — The Lord thy God will raise up unto thee a Prophet from the midst of thee, of thy brethren, like unto me; unto him ye shall hearken (Deuteronomy 18:15).
This was actually a prophecy of Christ Himself. For Moses truly said unto the fathers, A prophet shall the Lord your God raise up unto you of your brethren, like unto me; Him shall ye hear in all things whatsoever He shall say unto you (Acts 3:22).