An early discussion of this is found in Treatise, 3.2.7:
Two neighbors may agree to drain a meadow, which they possess in common; because it is easy for them to know each others mind; and each must perceive, that the immediate consequence of his failing in his part, is, the abandoning the whole project.
But it is very difficult, and indeed impossible, that a thousand persons should agree in any such action; it being difficult for them to concert so complicated a design, and still more difficult for them to execute it; while each seeks a pretext to free himself of the trouble and expense, and would lay the whole burden on others.
Political society easily remedies both these inconveniences. Magistrates find an immediate interest in the interest of any considerable part of their subjects. They need consult nobody but themselves to form any scheme for the promoting of that interest. And as the failure of any one piece in the execution is connected, though not immediately, with the failure of the whole, they prevent that failure, because they find no interest in it, either immediate or remote.
Thus bridges are built; harbors opened; ramparts raised; canals formed; fleets equipped; and armies disciplined everywhere, by the care of government, which, though composed of men subject to all human infirmities, becomes, by one of the finest and most subtle inventions imaginable, a composition, which is, in some measure, exempted from all these infirmities.
Thus, regarding conscription, for example, we can say that the only two desirable outcomes are "everybody fights" and "nobody fights." If only some, such as the bravest, fight, then they all perish due to insufficient numbers, and the rest of the cowards are slaughtered shortly thereafter or enslaved by the conquerors.
Now conscription is usually to be condemned, but only because wars made easier though it are to be condemned. Without the government, the only possible outcome is "nobody fights." The government permits the community to have a choice in this matter, i.e., between "nobody fights" and "everybody fights." Perhaps "nobody fights" is in a given case / usually / under laissez-faire / always the right choice, but the government allows the choice to be made, as opposed to letting the default situation of "nobody fights" arise willy-nilly.
This post concludes my live blogging of Hume.