The answer to this question is in the previous three verses, Matt 3:7-9 of which V10 is the summary and conclusion:
7 But when John saw many of the Pharisees and Sadducees coming to his place of baptism, he said to them, “You brood of vipers, who
warned you to flee from the coming wrath? 8 Produce fruit, then,
in keeping with repentance. 9 And do not presume to say to
yourselves, ‘We have Abraham as our father.’ For I tell you that out
of these stones God can raise up children for Abraham.
Thus, John the Baptist was warning the Jewish leadership, Pharisees and Sadducees, against their theological and spiritual arrogance and surly superiority. Then he bluntly warns them that just because they were the chosen people does not guarantee their salvation - God could raise up others in their place if needed!!
He then concludes using a common idiom of a tree symbolizing people:
The axe lies ready at the root of the trees, and every tree that does
not produce good fruit will be cut down and thrown into the fire.
That is, God has the axe raised and ready to cut down the chosen people and raise up others for the task unless you repent and "produce works in keeping with repentance".
Ellicott offers these comments:
The ax is laid unto the root of the trees.—The symbolism which saw in
“trees” the representatives of human characters, of nations, and
institutions, had been recognised in Isaiah’s parable of the vine
(Isaiah 5:1-7), in Jeremiah’s of the vine and the olive (Jeremiah
2:21; Jeremiah 11:16), and the Baptist’s application of it was but a
natural extension. Judgments that were only partial or corrective were
as the pruning of the branches (John 15:2). Now the axe was laid to
the root, and the alternative was preservation or destruction. For the
unfruitful tree there was the doom of fire.
This is a very sobering thing. Jesus said something very similar later in His ministry in Matt 21:43 -
"Therefore I tell you that the kingdom of God will be taken away from
you and given to a people who will produce its fruit.
Again, we have the same idea in Matt 23:37, 38 -
O Jerusalem, Jerusalem, who kills the prophets and stones those sent
to her, how often I have longed to gather your children together, as a
hen gathers her chicks under her wings, but you were unwilling! Look,
your house is left to you desolate.
Jesus like the metaphor of the plants symbolizing people as He uses it again, with the same idea in the parable of the vine as per John 15:1-8. Note V2 -
He cuts off every branch in Me that bears no fruit, and every branch
that does bear fruit, He prunes to make it even more fruitful.