Tax Incidence and Deadweight Loss
When a government creates a tax, it artificially raise prices for consumers and producers, meaning that the market price likely is no longer at the equilibrium. Tax incidence is an analysis of who ultimately bears the burden of the tax, since sometimes it greatly affects the producers who can't sell at the higher prices while sometimes consumers choose to absorb the tax entirely.
Taxes can be used to fund public goods and services, like infrastructure and public schools, or they can be used to dissuade consumers from certain harmful behaviors like smoking. Regardless of use, implementation of taxes can sometimes be dependent on political ideologies, so it's important to understand the effects of any type of tax on the markets.
Consumers and producers both have to pay taxes, but ultimately, the elasticity of the good determines who carries the burden of the tax. Take an elastic good like coca cola. If a consumer doesn't want to purchase a coca cola, they can get a Sprite or lemonade or good ol' fashioned water. So a tax on coca cola would mostly be paid by the producers, as the higher prices cause a large number of users to switch to an alternative product.
Moreover, the large change in the market causes maximum deadweight loss, as resources are being allocated inefficiently. On the other hand, the demand for cigarettes—or e-cigarettes and vapes for you millenials—is fairly inelastic. A tax on cigarettes would be paid mostly by the consumer as most consumers won't be swayed by higher prices. Taxes on cigarettes don't really work on curbing nicotine users' habits. However, because these taxes don't have a large effect on consumption, they generate the most revenue and the least deadweight loss.