Now when John heard in prison about the deeds of the Christ, he sent word by his disciples
Matthew 11:2

Although John the Baptist had not witnessed the miracles and teachings of Yeshua himself, he had heard much about them. Yeshua turned water into wine, released those held captive by unclean spirits, preached hope to the poor and oppressed, raised the dead, healed the sick, cleansed lepers and others trapped in unclean states beyond their power, healed the blind, mute, and lame, and commissioned disciples of his own.