what does the bible say?
The Bible indicates that John the Baptist sent his disciples to ask Jesus if He was the Messiah (Matthew 11:2). Plausible reasons for his question are fear caused by his circumstances and his assumptions about the Messiah.
John recognized Jesus as the Messiah (John 1:29), had witnessed God's Spirit descending on Him, and had heard the Father identifying Jesus as His Son (Matthew 3:16-17). But later when Herod Antipas threw John in prison with the intention of beheading him, John likely fell prey to fear and doubt. He may have had a similar view of the Messiah that other followers of Jesus had, i.e., that the Messiah would come as an earthly Conquerer, to restore the nation of Israel (Luke 19:11, 3:7-9). When he didn't see that happening, he may have needed additional reassurance of Jesus' identity.
Jesus' answer to John's followers was to point to the miracles He was performing, miracles that only God could perform (Isaiah 35:5-6;
Luke 7:22). Jesus reminded John of who He is: the eternal, everlasting God.