The Unconquered Land and Eastern Inheritances
Not all of the land was conquered in the previously described wars. There were still sections, such as the land of the Philistines in what is now known as the Gaza Strip, which the Israelites did not yet possess.
The land was divided among the tribes, but not all of the Canaanites were driven out. More details are given in the book of Judges (see Judges 1). So, too, are some of the reasons for God not driving them out (compare Judges 2; 3:1-6). The Israelites lacked the diligence, zeal and spirit to obey God, and God used the Canaanites to test them. In fact, the entire book of Judges is a chronicle of Israel's failures in this regard. Many victories (e.g., Jerusalem, 2 Samuel 5:6-10 2 Samuel 5:6-10  And the king and his men went to Jerusalem to the Jebusites, the inhabitants of the land: which spoke to David, saying, Except you take away the blind and the lame, you shall not come in here: thinking, David cannot come in here.
 Nevertheless David took the strong hold of Zion: the same is the city of David.
 And David said on that day, Whoever gets up to the gutter, and smites the Jebusites, and the lame and the blind that are hated of David's soul, he shall be chief and captain. Why they said, The blind and the lame shall not come into the house.
 So David dwelled in the fort, and called it the city of David. And David built round about from Millo and inward.
 And David went on, and grew great, and the LORD God of hosts was with him.
American King James Version×) waited 400 years until the days of David.