From the time of Locke (1967), theoretical analysis of the role of government distinguished those services that can be provided at lowest cost if provided collectively. These goods and services, usually called public goods, are part of a potentially larger class of goods that are subject to external economies or diseconomies in production or consumption.
Modern governments do not limit their activities to the provision of public goods and the elimination of external effects. Governments supply services that can be produced privately. At times, public and private supply coexist. Housing services, medical care and education are examples, but so too are consumer protection, safety and many of the so-called regulatory activities.