After they captured the city which had strong walls around it, David moved there. That is why they named it ‘The City of David’.