God told the Israelites to kill them all, or they would be trouble later...WHEN WAS THAT?
Samuel said to Saul, I am the one the Lord sent to anoint you king over his people Israel; so listen now to the message from the Lord. 2 This is what the Lord Almighty says: I will punish the Amalekites for what they did to Israel when they waylaid them as they came up from Egypt. 3 Now go, attack the Amalekites and totally destroy all that belongs to them. Do not spare them; put to death men and women, children and infants, cattle and sheep, camels and donkeys.Saul did not do that and was removed as king in favor of David. The entire book: 1 Samuel 15
Didn't say to KILL THEM ALL... very specific. And for reasons most Bible scholars never care to explore. The above link is some very good reading.
Numbers51 Speak unto the children of Israel, and say unto them, When ye are passed over Jordan into the land of Canaan;
52 Then ye shall drive out all the inhabitants of the land from before you, and destroy all their pictures, and destroy all their molten images, and quite pluck down all their high places:
53 And ye shall dispossess the inhabitants of the land, and dwell therein: for I have given you the land to possess it.
54 And ye shall divide the land by lot for an inheritance among your families: and to the more ye shall give the more inheritance, and to the fewer ye shall give the less inheritance: every man’s inheritance shall be in the place where his lot falleth; according to the tribes of your fathers ye shall inherit.
55 But if ye will not drive out the inhabitants of the land from before you; then it shall come to pass, that those which ye let remain of them shall be pricks in your eyes, and thorns in your sides, and shall vex you in the land wherein ye dwell.
This may not be what the poster wrote about but it is similar:
Numbers 33:55-56 “But, if you do not drive out the inhabitants of the land, those you allow to remain will become barbs in your eyes and thorns in your side. They will give you trouble in the land where you will live. And then I will do to you what I plan to do to them.” (God is speaking to Moses.)