Hubbard and O'Brien does a not-so-great job of explaining where the deadweight loss arising from an externality comes from.
So I made a little exhibit to try to break it down a bit. I chose the positive externality (benefit) case to illustrate. Can you figure out how to do the negative externality (cost) case?
Go to "Forms and Docs" to see the exhibit.