If you hear it said about one of the towns the Lord your God is giving you to live in that troublemakers have arisen among you and have led the people of their town astray, saying, “Let us go and worship other gods” (gods you have not known), then you must inquire, probe and investigate it thoroughly. And if it is true and it has been proved that this detestable thing has been done among you, you must certainly put to the sword all who live in that town. You must destroy it completely, both its people and its livestock. You are to gather all the plunder of the town into the middle of the public square and completely burn the town and all its plunder as a whole burnt offering to the Lord your God. That town is to remain a ruin forever, never to be rebuilt, and none of the condemned things are to be found in your hands. Then the Lord will turn from his fierce anger, will show you mercy, and will have compassion on you. He will increase your numbers, as he promised on oath to your ancestors—because you obey the Lord your God by keeping all his commands that I am giving you today and doing what is right in his eyes.
1-Is this verse referring to (A) the towns in Caanan where people worshiped false gods, or is it referring to Israelites living in their towns(B)?
2-If B, was it a literal command, or just a command to emphasize how seriously God viewed idol worship? While God commanded various kings, like Asa and others, to destroy the idols people in Israel built, I dont remember any of those kings wiping out towns where idol worship took place in.
3-If the command God gave to Israel was a literal command, was it just for the Israelites to wipe out the inhabitants of an entire town because some people in the town were idol worshippers?