When a firm considers a new project, they will conduct a cost-benefit analysis to determine if the project is worth pursuing. This is a careful weighing of all of the downsides (costs) and upsides (benefits) of completing the project. If the benefits of the new project outweighs the cost of building or implementing it, than the firm will go ahead with the project. The determination of the cost of a project is not only the dollar amount that it costs to complete a project but the social cost and political cost created by the project. The downsides of a project that are not directly reflected in the price are called externalities.
Just as the cost calculation takes into account more than the direct cost of building a project, the benefit analysis takes into account more than just revenue made from the new project. The benefits also include positive externalities and any other benefit a project would render if built.
There is a distinction between projects that are privately profitable and those that are socially profitable.
A project that is privately profitable is one where the revenues generated by the project exceed the cost incurred by the firm to build it.
For example, if a firm wants to build a new natural gas power plant but there is not enough demand for the electricity it will generate, the firm will not be able to build the project because not enough consumers will buy the electricity. This project would not be privately profitable and the firm would not build it.
A project that is socially profitable is one where the social benefits exceed the social cost. For example, the building of a university or higher learning institution where there isn't easy to a higher level of education. Education is a positive externality meaning it has a net social benefit to society and has very little, if no, social costs associated with it. Assuming the institution is setup to be privately profitable, the project will pass the cost-benefit analysis.
In cases where a project is socially profitable but is not privately profitable, there is an incentive for a government to subsidize the project to make the project both socially and privately profitable. This could apply to a situation where a city wants to reduce its reliance on electrical generation methods that pollutes the atmosphere such as coal or natural gas. It might not be privately profitable for a firm to build a wind farm, nuclear plant, solar farm or other type of renewable system. A government could offer a subsidy to make the project profitable for the firm. Also firms will build wind farms which don't make a profit if they believe that the wind farms will help them to be more popular with the people in an area, a practice that is part of green-washing. This is an example of a how companies invest in public perception.
Just as it can be good to offer a subsidy to a socially profitable project to make it privately profitable, it can be good to prevent a project that is privately profitable but not socially profitable. For example, a firm wants to open a coal plant and metal smelting plant beside each other and the operation of the plants creates a large amount of pollution that could harm citizens of the city. While the company will make money from the project, the city could block the construction under the justification that the social cost is too large.
One problem with the inclusion of a social aspect in a cost-benefit analysis is the difficulty of measuring social costs and benefits. It is difficult to determine the exact amount of benefit or harm that an activity produces. While it is easy to determine private profitability by subtracting the cost from the expected revenue, it is hard to determine how much benefit or harm an activity will cause, for this some guessing is required. The building of a university might be pointless if there is no demand for education. Greenhouse gases emitted from a potential coal or natural gas plant must be weighed against the difficulties of not having electricity.