In this account of John's work his scathing words were addressed to members of the Pharisee and Sadducee sects, who evidently flocked in great numbers to his baptism.
They were alarmed and disturbed at his preaching and feared that the drear time of awful suffering, generally known as the "woes of Messiah," which their great rabbis had told them would precede Messiah's advent, was at hand. They would provide themselves with some talisman against this time of sore calamity. This baptism would be surely a safeguard, an easy bit of ritual, so they came to him in numbers.
But John read their hearts; hence his stern fiery rebukes.
He says to them: "Since you profess to have taken flight from the wrath to come, show at once, by your change of life, that your repentance is worth something, has some meaning in it."
Then he intensifies his statement respecting the power of God to raise up, out of the very river shingle at their feet, children who should inherit the glorious promises made to Abraham.
Within forty years of that time would the fatal axe, now lying at the root of the tree, be lifted.
[Excerpt from The Pulpit Commentary]