But the prophet who speaks a word presumptuously in My name which I have not commanded him to speak, or which he speaks in the name of other gods, that prophet shall die.’ You may say in your heart, ‘How will we know the word which the LORD has not spoken?’ When a prophet speaks in the name of the LORD, if the thing does not come about or come true, that is the thing which the LORD has not spoken. (Deuteronomy 18:20-22a)
In contrast to the true prophet, Moses predicted there would be false prophets who would come to Israel, speaking not in the name of the Lord, but in the name of false gods. How could the people tell if a prophet was authentically speaking for God? Moses said, “if the word does not come to pass,” it was not from God. The characteristic of false prophets is the failure of their predictions to always come true.
Sometimes false prophets speak and it happens as they said, but they are representing false gods and trying to turn people from the true God—they must be rejected and executed. Other times, false prophets are more subtle and identify with the true God but speak lies. If ever a prophecy of such a prophet fails, he is shown to be false.
John MacArthur Commentary