The Economic Origins of the Territorial State