There is a delicious anecdote in Ben Wilson’s “Metropolis: A History of the City, Humankind’s Greatest Invention” that serves as a microcosm of many of the book’s themes. In medieval Florence a smith was toiling away in his workshop and singing a poem by Dante. In stormed a furious man, who threw the smith’s tools into the street. “What the devil are you doing?” asked the astonished smith. “If you don’t like me spoiling your things, don’t spoil mine,” replied the man, who turned out to be the poet himself. The story—its juxtaposition of artist and artisan, art and artifact, of social classes—encapsulates some of the features that Mr. Wilson believes make certain cities great and necessary for civilization. In his excellent, thought-provoking, heady urban chronicle, he proves his point. Space constraints compel me to restrict myself to only a few of the book’s high (and low) lights. In the beginning, circa 5000 B.C., was Uruk, the first city, in what was then Mesopotamia (now Iraq). It was, to borrow a word Mr. Wilson uses to delineate another city, a palimpsest, an accumulation of eras built over each other. Uruk also contained, inevitably, a mingling of the good and the ghastly. There was its remarkable architecture (mostly religious edifices). The city was the site of the first number system and the “first techniques of mass production.” And “the written word”—cuneiform—was “invented in Uruk.” As for the dreadful aspects: Slavery existed within its precincts. This book sifts through barbarous cities: Tenochtitlán, the Aztec capital on the site of what is now Mexico City, was by all accounts quite lovely, but every year thousands of hapless people were “sacrificed”—slaughtered—at its Great Temple. It examines beleaguered, brutalized cities, such as Warsaw and Leningrad during World War II. It also surveys 17th-century Amsterdam, which sounds like a delightful place: cosmopolitan, “a patchwork of different faiths,” including that of the Portuguese Jews who had fled the savage violence and forced conversions of their native land. Amsterdam was “conceived around the needs of its citizens,” we are told, “not around monumentality or expressions of power.” As such, the city’s leaders allowed Amsterdam to become a “cauldron of radical ideas”: The works of Descartes, Galileo, Hobbes, Locke and Spinoza, censored elsewhere, were published there. It is clear from the book’s account that Amsterdam’s social and cultural exuberance were strongly underpinned by its economic prosperity. That prosperity, in turn, was the corollary of a business-financial system that was the precursor of modern capitalism. The city was the headquarters of the Dutch East India Co., “a government-backed for-profit corporate imperial power” that dispatched traders across the globe (and in 1624 founded New Amsterdam). It had the world’s first securities market and the Amsterdam Exchange Bank, which created many modern banking innovations: checks, direct debits, account transfers. It was also where “the world’s first recognizably modern broadsheet newspaper” was established. Amsterdam, Mr. Wilson writes, “focused on profit” and was “unafraid of free thought.” In our era, Lagos, Nigeria, “is predicted to be the largest city in the world by the middle of this century, its population set to double to over 40 million people by 2040.” On one level Lagos is the epitome of urban despair, “infamous for its sprawling slums, corruption and crime, its appalling infrastructure and the worst traffic jams in the world.” And yet Mr. Wilson is encouraged and excited. He chronicles the rather extraordinary technology businesses that thrive in the slums—device repairs and refurbishing, to name two—that allow poor residents to make do and, more important, provide a path to upward mobility. “In Lagos between 50% and 70% of people sustain themselves in the informal sector,” he tells us. There are “an estimated 11 million ‘micro-enterprises’ in Lagos.” Mr. Wilson summarizes a major characteristic of the city this way: “Lagos’s energy and creativity emerges in large part from its apparent chaos and its people’s ingenuity in innovating their way out of the city’s pitfalls.” As for Lagos as a whole, it “pulsates with a crazy energy; its dynamism is intoxicating.”