John's disciples tell him about everything Jesus has accomplished. Remember that John is in prison (3:19-20), but apparently he can receive visitors.
John sends two of his disciples to Jesus and asks point blank: "Are you the one who is to come, or are we to wait for another?" Even John wants to be sure that his own prophecy is being fulfilled through Jesus.
The disciples ask Jesus this just as he's busy healing, exorcizing, and granting sight to the blind. You might as well ask an NBA basketball player if he can dunk.
Jesus tells them to inform John what he's doing: the blind see, the crippled walk, lepers are cleansed, the deaf hear, corpses revive, and the poor open their morning papers to read good news.
So yeah, he's the one.
Jesus adds that happiness belongs to anyone who's not offended by him.
John's disciples head off—John will be able to put two and two together.
Jesus offers his own very high opinion of John, and then he asks the crowds rhetorically what they went out to the desert to see. A prophet, duh.
John is the guy that scripture was talking about when it says, "See, I am sending my messenger ahead of you, who will prepare your way before you" (7:27). Go and read it for yourself in Exodus 23:20 and Malachi 3:1.
John surpasses everyone "born of women" (7:28), i.e., everyone.
But in God's kingdom, even the least is greater than he is. Wait, what? That's what you might call a paradox.
The people and the tax collectors are all psyched about this, since they had been baptized by John (rewind to 3:3-14).
The religious highbrows, on the other hand, weren't baptized by John and are said to have "rejected God's purpose" (7:30). Warning: Don't reject God's purpose.
Jesus compares the people of his generation to children playing in the marketplace, shouting to each other, "We played the flute for you and you did not dance; we wailed, and you did not weep" (7:32 NRSV). The people who refuse to play along are a bunch of spoilsports.
John doesn't eat and is a teetotaler, but he's accused of being demon-possessed.
Then the Son of Man comes partying hearty, but he's accused of being an overeater and alcoholic, the best friend of bar hoppers and the IRS.