One commentator wrote, " . . . he was not brought up in the schools of the prophets, nor in the academies of the Jews, or at the feet of any of their Rabbins and doctors; that it might appear he was not taught and sent of men, but of God." The Jamieson, Faucett, and Brown commentary agrees when it states " . . . free from rabbinical influences and alone with God, his spirit would be educated, like Moses in the desert, for his future high vocation."
Returning to Gill's notes we read, " . . . and that it might be clear he had no knowledge of, nor correspondence with Jesus, whose forerunner he was, and of whom he was to bear testimony."
If John had no knowledge of, nor correspondence with Jesus, it had to be through the holy spirit that he was able to assert that he was the lamb of God (John 1:29, 36). Later he spoke out against king Herod, warning him his marriage to his sister-in-law was unlawful (Mark 6:17 - 18). For this, he ended up in prison.
After learning that John the Baptist had been incarcerated in Galilee Jesus left for the area (Matthew 4:5 - 12). What few people who study the Bible realize is that, although the Baptist had proclaimed Jesus as the lamb of God, he had not personally witnessed any of his miracles. The Jews in the first century were expecting a Messiah who would free them from Roman control. Jesus' mission had nothing to do with gaining Judea's independence so, in prison, John had time to think and entertain doubts. He began to hear about the works of Christ, and may have wondered why Christ did not deliver him. Eventually, he sent two of his disciples to ask a few questions (Matthew 11:1 - 3) of Jesus. The answer they took back with them was to-the-point.
". . . tell him what you hear and have seen for yourself, that the blind and lame and lepers and deaf are healed, the dead are raised up, and the poor hear the good news of God's kingdom. Happy is he who has no doubts about me." (Matthew 11:4 - 6)
All this was heard by the people who surrounded them. They must have had some doubts about John, since he sent emissaries to question Jesus. But Jesus had no such doubts. He asked them what they went out into the wilderness to see: a weak, spineless person shaken by every wind of doctrine? Or a man in soft clothing? If that is what they expected, they were mistaken. And one has to wonder whether Jesus' next statement was a jab at Herod. He said, "Those who wear silks and satins are in kings' houses " (verses 7 - 8).
Realizing that some of the people went to see a prophet, Jesus commended John the Baptist to them saying he was more than a prophet (verse 9). He was the one Malachi spoke about (Malachi 3:1) who would prepare the way for the Savior.