Now it turns out (with-hindsight-20/20) that Adam Smith did not fully understand the "mind" behind the "invisible hand". It indeed does arrange for social benefits... except when it doesn't[0]. A good contemporary analysis of this mechanism is the article by Scott Alexander, "Meditations on Moloch".
http://slatestarcodex.com/2014/07/30/meditations-on-moloch/
--
[0] - For instance, a lot of those social benefits are in fact signs of market inefficiency, and those eventually get "corrected" as more and more people compete in a given sector and the margins dwindle.