It was not until the mischievous moralist Bernard Mandeville that someone attempted to gloss greed as anything other than a shameful motive. A name now largely lost to history, Mandeville became a foil for 18th-century philosophy when, in 1705, he first proposed his infamous equation: Private vices yield public benefits. It came as part of The Fable of the Bees, an allegorical poem that described a thriving beehive where dark intentions keep the wheels of commerce turning. The outrage Mandeville stoked had less to do with this causal explanation than with the assertion that only by such means could a nation grow wealthy and strong. As he contended (with characteristic bluntness) in the conclusion to the Fable:

T’ enjoy the World’s Conveniences,

Be fam’d in War, yet live in Ease,

Without great Vices, is a vain

EUTOPIA seated in the Brain.

Philosophers lined up to take their shots at Mandeville, whose moral paradox seemed so appalling precisely because it could not be so easily dismissed. The most notable among them was Adam Smith, the founding father of modern economics, who struggled to distinguish the mainspring of his system from the one Mandeville proposed.

Consider how Smith describes the selfish landowner, of whom he says the “proverb, that the eye is larger than the belly, never was more fully verified.” Looking out over his fields, in his imagination, he “consumes himself the whole harvest.” The belly, however, is not so obliging. The greedy landlord may engorge himself without making a dent in his crop, and he is “obliged to distribute” the rest in payment to all those who help supply his “economy of greatness.”

This is Smith’s Invisible Hand at work. It is counterintuitive force for good that, on first glance, seems not especially different from Mandeville’s contention that private vices yield public benefits. Smith was sensitive to this fact—Bernard Mandeville did not exactly make for good company—and he struggled to create distance between them.

He did this in two ways. First, Smith emphasized the moral distinction between primary aims and secondary effects. The Fable of the Bees never explicitly claimed that vice was good in itself, merely that it was advantageous—a subtle distinction that created confusion for Mandeville’s readers which the author, a cynic through and through, made little effort to dispel.

Smith, by contrast, made abundantly clear that, as a matter of moral assessment, one should distinguish between the intentions of an actor and the broader effects of his actions. Recall the greedy landlord. Yes, the primary aims of his daily labors—vanity, sway, self-indulgence—are far from admirable. But in spite of this fact, his efforts still have the effect of distributing widely “the necessaries of life” such that, “without intending it, without knowing it,” he, and others like him, “advance the interest of society.” This is another way of saying, for Smith, the moral logic of free markets was a law of unintended consequences. The Invisible Hand gives what a greedy landlord takes.