While you would never know it from Ph.D. classes in economics, one of the most fundamental insights from economics is "spontaneous order theorizing." Basically, many of the aspects of our society have arisen spontaneously without anyone planning them. These phenomena, like money, language, or law, are the result of purposeful human action, but are not of human design. It is a powerful model for understanding the world. For an overview of the topic, check out this article.
The two most famous economists who worked within this framework are Hayek and Adam Smith. While many writers have lumped them together, they disagreed on many issues. This is understandable since both wrote on wide-ranging topics.
If you would, allow me to put down a few thoughts I'm having about their differences on the breakdown of spontaneous order. This differences don't affect the spontaneous order model from a positive point of view, but might from a normative.
Problems within Spontaneous Orders
A split between the two giants occurs on the issue of “social justice” with Smith providing a list of exceptions to the benefits of spontaneous order. One explanation of the split is given by Laurent Dobuzinskis, who sees Smith as emphasizing both of the sentiments of liberty and sympathy. Sympathy is not a major concern for Hayek.
In contrast, Hayek focuses almost exclusively on liberty since he is a “classical liberal for whom private property rights were paramount” (Dobuzinskis, 2008, 94). The concern with sympathy explains why, in Smith’s worldview, nonmarket institutions can play a part in providing public goods such as basic education, regulation, and economic support for the poor (Sen 2011, 259). Indeed, Smith saw intervention in the interest of the poor as beneficial to the society. “When regulation, therefore is in favour of the workmen, it is always just and equitable” (A. Smith,  2001, 356). In fact, there is a list of interventions authorized by Smith.
In 1787, Jeremy Bentham complained that Adam Smith was unable to see all the virtues of the market economy, since Smith criticized the “prodigals and projects” that were a natural part of a market. Smith also supported state regulation of financial transactions (Sen, 2011, 258) since a totally spontaneous, unregulated market can easily pave the way for “a great part of the capital of the country” being “kept out of the hands which were most likely to make a profitable and advantage use of it, and thrown into those which were most likely to waste and destroy it” (A. Smith,  2001, 356).
Justice is commutative for Smith and requires negative obligations (justice requires that people not steal compared but people are not required to help the poor) to protect others. Ultimately, Smith believed that injustice could be reduced through governmental institutions (Sen, 2011, 267). This requires an intervention into the workings of spontaneous order, sometimes to a great extent.
Hayek sees the need for government (he was not an anarchist), but believes the purpose of intervention is quite different. While Hayek believes in general rules, such as those governing property and protecting peace. Yet, government cannot provide for “social justice”. While Smith sees legislation to correct what he saw as errors of spontaneous order, Hayek defines the nature of law as “purpose-independent rules” meant to give a framework for the interaction between people. Laws should apply to “an unknown number of future instances” in order to offer a “protected domain”. This would “enable an order of actions to form itself wherein the individuals can make feasible plans” (Hayek, 1973, 85–6).
Thus, he writes that a society should function under a rule of law, or ‘meta-legal doctrine’ (Hayek, 1960, 206), which prescribes legislation by the above definition. The purpose of judges and legislators is to select those rules which worked in the past and should be held up to make it more likely that individuals’ expectations will match the real rules (Hayek, 1973, 119). This system of order provides justice precisely because it develops from general rules of behavior and not in pursuit of any individual’s purpose. Society cannot possibly agree on ends; it can find agreement on means and the framework to create. These rules can proscribe types of action but should not reference the ends which any part of society aims. Hayek terms the order that spontaneously arises from such a process as a ‘cosmos’: an order which results from the adherence to abstract general rules with no agreement as to ends (Hayek, 1978: 76).
If you'd allow me to go make a bold claim. This difference between Smith and Hayek provides a major basis for a split between certain modern-day conservatives and libertarians. Small government conservatives have followed Adam Smith more and libertarians have followed Hayek.
Dobuzinskis, Laurent. “‘The Adam Smith Problem’ Revisited: Comparing Hayek’s and Fouillee’s Answers.” Studies in Emergent Order 1 (2008): 92-118.
Hayek, F. A. The Constitution of Liberty. London: Routledge, 1960.
Hayek, F. A. Law, Legislation and Liberty: Vol. 1, Rules and Order. Chicago: University of Chicago Press, 1973.
Hayek, F. A. Law, Legislation and Liberty: Vol. 2, The Mirage of Social Justice. Chicago: University of Chicago Press, 1978.
Sen, Amartya. “Uses and Abuses of Adam Smith.” History of Political Economy 43 (2011): 257-71
Smith, Adam. (1776) An Inquiry into the Nature and Causes of the Wealth of Nations. London: Elecbook, 2001.