People tend to over-invest in negative externalities (because someone else pays part of the cost) and under-invest in positive externalities (because someone else enjoys part of the benefit).
Pollution and climate change are two stark examples of the former. Because I don't have to pay my share of health care and infrastructure costs for the exhaust coming out of my car, I will tend to buy a bigger car than I would if the cost of that car included those externalized costs.
Gas and carbon taxes are mechanisms to internalize those negative externalities. They create an incentive for drivers to buy more fuel-efficient vehicles, which creates an incentive for automakers to manufacture more fuel-efficient vehicles. This is why European cars are on average much smaller and more fuel efficient than American cars, despite the fact that Europeans and North Americans drive roughly the same annual distance (17,000 miles and 18,000 miles, respectively.)
Another mechanism is the American CAFE system, which arguably does a worse job because it gives automakers an incentive to find loopholes in vehicle designations. We can thank CAFE for the preponderance of SUVs on the market.
On the other side of the coin, education has a positive externality because some of the benefits of an individual's education accue to society as a whole. Given straight market forces, individuals will on aggregate under-invest in their own education, and the economy as a whole will suffer from a lower mean worker productivity.
Every industrialized country quickly landed on universal public education because the aggregate benefits to productivity that come from a universally educated populate more than offset the higher cost to educate everyone. That is, even though average taxes are higher to help pay for education, average incomes are higher still.