Answer
God called Abraham to go to an unknown land that would be revealed to him (Genesis 12:1). The Lord led Abraham to that land, Canaan, but Abraham lived there as a “stranger,” and God promised that his descendants would own it (Genesis 17:8). God also told Abraham that his descendants would be captive in a foreign nation for about 400 years but that God would bring them back to the land He had promised. They would conquer the land, and this conquering would be a judgment upon the inhabitants of the land at that time (Genesis 15:13–16).
Abraham’s grandson Jacob (Israel) went down to Egypt with all his family, about 70 in all (Genesis 46). They lived and thrived in Egypt for many years until they became so strong and numerous that the Pharaoh felt threatened by them, so he enslaved them (Exodus 1:1–14). God delivered them from Egypt (Exodus 2—12), and they journeyed back to the Promised Land.
As the Israelites were preparing to go in and take possession of Canaan through conquest, twelve spies were sent on ahead to scout out the land. They all agreed that the land was good and that the people there were strong. Ten of the spies said they were incapable of taking the land, while only two, Joshua and Caleb, trusted that the Lord would give them the land (Numbers 13). The people listened to the ten spies and revolted. As a result, God said that none of those adults alive at the time would enter the Promised Land except Joshua and Caleb (Numbers 14).
When that generation including Moses died off in the intervening years, Joshua was finally ready to lead a new generation of Israelites in to conquer the Promised Land. The Old Testament book of Joshua tells the story of the conquest, and what follows is a brief summary:
The first major target was the city of Jericho in the middle part of Canaan (Joshua 2). God dried up the Jordan River, the boundary of Canaan, so that the whole nation could pass over on dry ground (Joshua 3). However, the attack on Jericho was unconventional. It was to be done in such a way that all would know that it was God who was giving Israel the victory. Instead of laying siege to the city, the people would simply march around it for seven days. On the seventh day, the walls fell down and Israel stormed the city, putting to death all the inhabitants (except Rahab and her family. See Joshua 2). The Israelites were to take no spoils, as everything was to be dedicated to God (Joshua 6).
The next target was the city of Ai. The Israelite army felt this would be an easy victory, but, unexpectedly, the men of the city defeated Israel. It turns out that God was not with them because one of the men of Israel had taken some forbidden items from Jericho. Once that was dealt with, then Israel defeated Ai (Joshua 7—8). After the victory at Ai, Joshua renewed the covenant with the people at Mount Ebal (Joshua 8:30–35).
It is important to remember that, at this time, Canaan was not a nation but a land area where kings ruled over cities and territories. A group of five Amorite kings decided that they should align themselves and preemptively attack Israel, but they were all defeated (Joshua 10). Later, another group of kings in the northern half of Canaan also formed a confederacy to attack the Israelites; they, too, were defeated (Joshua 11). Joshua and the people of Israel continued the conquest until all of Canaan was subdued (Joshua 11:23). Israel’s strategy seems to have been to defeat the strongest cities first (Joshua 12) and then to divide the territory among the individual tribes and allow each tribe to finish conquering their own territory (Joshua 13—22).
During the conquest of Canaan, God intervened miraculously on several occasions, including the day the sun stood still (Joshua 10). Israel was largely successful in defeating or driving out the Canaanites; however, they were not completely successful. Sometimes they left pockets of Canaanites to continue to rule themselves, and sometimes they enslaved the Canaanites (Judges 1). Both of these things had been forbidden by God, who told Israel to drive them out completely (Deuteronomy 7:2). As a result, the Canaanites remaining in the land became a temptation and a snare to the people of Israel. At times Israel would worship the Canaanites’ gods, and at times God would allow those remaining pagans to rule over them. The book of Judges tells the story.
Today, there are many who find fault with a God who would order “genocide.” However, the Bible makes it clear that God was sending Israel into the Promised Land to punish the people who were living there for their wickedness. Certainly God has the right to administer judgment in this way.