The swath of the South Bay once so prized for its orchards and all-round Edenic charm that it was dubbed “the Valley of Heart’s Delight” has spawned myriad imitators. Reflecting local topography, there’s Silicon Glen, Silicon Fen, Silicon Roundabout, Silicon Steppe and, most egregiously, Philicon Valley (take a bow Philadelphia), among other wannabes.

But there’s only one Silicon Valley. How to explain the sui generis success of this “high-tech Galapagos?” Margaret O’Mara’s “The Code: Silicon Valley and the Remaking of America” sets out to crack the elusive code behind the code that has supplanted fruit as the valley’s main export. The result is a fresh, provocative take that upends the self-serving mythologizing of the valley’s own.

Conventional wisdom depicts the valley as a place apart, remote from and unbeholden to old power centers, the product of rugged individualism, its history a pageant of eureka moments in garages and dorm rooms. In this telling, government figures barely — as a scold or spoiler to be kept at bay — if at all.

A historian who worked in the Clinton administration before entering academia, O’Mara posits a counter-narrative in which the valley owes its origins — and survival during lean times — to defense contracts, and government emerges as “perhaps its greatest … venture capitalist.” Whirring away in the background like electrical current through computer circuitry: a nexus of money, power and influence between the valley and Washington that predates Al Gore’s internet boosterism, Obama officials’ coziness with big tech or Google’s high-powered D.C. lobbying operation.

But O’Mara is hardly proposing the valley as a creature of big government-by-stealth or enlightened bureaucratic design. Rather, the workings of government there have often been indirect, sometimes inadvertent, she writes, as much rooted in omission as commission — dwelling in the negative space of inaction and permissive regulation besides “largesse” and purposeful programs. Either way, a constant has been intensive politicking by valley brass — for all their professed libertarianism or apolitical leanings, far from passive recipients of grace and favor. It’s a frame that casts familiar figures in a new light. Storied venture capitalist John Doerr provided seed capital to Amazon, Google, Sun and Netscape but, an emissary to Washington’s elite, arch coalition builder and lobbyist in chief for the industry, he was also a consummate “policy entrepreneur,” O’Mara points out.

“The Code” doesn’t skimp on the milestones of valley lore — the “traitorous eight” splitting from Shockley Semiconductor to found Fairchild Semiconductor and modern-day Silicon Valley; or, “the mother of all demos” showcasing “the mouse, interactive computing, hyperlinks, networked video and audio” in 1968. But O’Mara spotlights the village of institutions, networks and ancillary services — corps of bankers, lawyers and marketers overlooked in many accounts of the valley’s exceptionalism — behind the big moments.

She also supplements them with a concatenation of ostensibly small deeds, obscure statutes, legislative arcana and legal loopholes that proved deeply consequential.

Consider an alternative valley timeline beginning with the 1958 Small Business Investment Act: in its generous matching loans for startup investors a catalyst for the first wave of VC firms.

And in 1994, when merchants eyed the nascent web as a medium of commercial exchange but consumers balked at entrusting their credit card to websites, enter the government with a means of protecting this data that laid down the rudiments of secure online transactions and helped jump-start e-commerce — perhaps “the greatest return on investment in Valley history.”

Meantime, we’re still living with the reverberations of fine print in the 1996 Communications Decency Act. Industry lobbying, and the efforts of civil liberties advocates, purged it of sanctions against online porn peddlers but not a clause absolving platforms of responsibility for content posted to their sites.

Overall, the Clinton administration ensured the infant web wasn’t captured by big business, but also that it wasn’t smothered by regulation.

Then there’s the outsize impact — for better and worse — of California’s proscription of non-compete job contracts, allowing workers to decamp with impunity to rival firms. This has fostered a certain industry-wide collegiality, not to mention a fluid job market. And it’s led to referral-based recruitment that’s proved expedient in tapping an industry-wide pool in which new hires are readily attuned to a prevailing culture and, interchangeable as widgets, quickly productive. But it’s also contributed toward a hermetic culture — self-propagating, incestuous and insular — in which recruitment has too often been confined to “charmed circles” of white, maybe Asian men, O’Mara writes. The result: “programmed in sharp gender and racial imbalances” — the valley’s historical blind spots, all the more glaring for their coexistence with its often otherwise progressive mores.

Such happenstances lack the sexiness of hackathons and product launches, but they’ve been formative in the valley’s culture and products. And they’re of more than academic interest as the pervasiveness of the valley’s cultural currency and products makes its pathologies, besides its ingenuities, the concern of us all.

Ironically, at a time when this influence is maximally felt, the valley is on its way to physically obsoleting itself, O’Mara adds. The cloud liberates entrepreneurs from place, permitting them to rent computing power and tap remote teams rather than investing in pricey hardware and on-site teams. And how many scrappy founders can afford to bootstrap a company in today’s valley? The obituaries are already being written. But the valley’s been written off before.

The Code: Silicon Valley and the Remaking of America

By Margaret O’Mara

Penguin Press

(512 pages; $30)