The Valley of Ben-Hinnom marked Judah's northern border. Jerusalem was along a narrow hilltop going north from the valley's lower end, within Benjamin's territory. Neither tribe controlled Jerusalem, so when David captured it, it became the royal city of his family line of kings instead of just another city of a tribe.