They journeyed to the entrance of Gedor, to the east side of the valley, to seek pasture for their flocks, where they found rich, good pasture, and the land was very broad, quiet, and peaceful, for the former inhabitants there belonged to Ham.
1 Chronicles 4:39-40 ESV

Sons of Ham were still occupying significant territory within Israel long after David took Jerusalem. The history of Israel seems to be full of incomplete victories that sow seeds of trouble for later generations.