I am currently learning high school level economics and I do not understand how indirect taxation may increase net social welfare in the presence of negative production externality.
This is because, from analysis of welfare in the market diagram with linear demand and supply curves, I found that the social welfare gain due to a tax correcting a negative production externality is equivalent to the welfare loss to consumers and producers from the taxation itself (resulting in no net change in total welfare).
Theoretically, this can also be explained by the fact that taxation reduces the net satisfaction of consumers, firms, and government, but increases net satisfaction in the 3rd party.
My current understanding is that correcting externalities do not cause net welfare to change, but it allows the socially optimum level of resources to be allocated to production, answering the "what to produce question" and allowing the economy to benefit in the long run, but I'm not at all sure.