David L. Ulin is the author of “Sidewalking: Coming to Terms with Los Angeles.” He is the former book editor and book critic of the Los Angeles Times.

About three-fourths of the way through “Boom Town,” his nuanced, immersive portrait of Oklahoma City, Sam Anderson takes a walk. It isn’t just any sort of walk — but then, Oklahoma City isn’t just any sort of town. It’s a walk back and forth through the city’s history. Anderson has just attended a Century Chest celebration at the First Lutheran Church, at which a time capsule, sealed 100 years before, has been unveiled.

Anderson is skeptical. “Time capsules are notoriously disappointing,” he writes. “They are supposed to be magical existential wormholes to a lost reality, but instead they are almost always empty, damaged, full of junk — further depressing evidence (as if we needed any) of the absolute tyranny of time.” The passage evokes its author deftly: the inside outsider, captivated but unconvinced, part of the collective while also essentially apart. The same might be said of Oklahoma City, which was created in a single day, April 22, 1889, when across the span of a few hours, the Oklahoma Land Run brought 10,000 residents to a place that had been occupied, previously, by no one.

Surprisingly, however, Oklahoma City’s time capsule contains real treasures: “A wooden Choctaw bow. A 1913 phone book, plus a clunky old-timey phone to make calls with. A judge’s gavel. A glass container of wheat.” Anderson is moved — or perhaps it’s more accurate to say he is overwhelmed. He drives out to the edge of the city, “as near as I could to . . . what the settlers of 1889 called the ‘Pott Line,’ because the territory on the other side belonged to the Potawatomi Indians.” This is one of the places the Land Run began.

For the rest of the day, he walks back into downtown, through empty streets and failed shopping centers, past prefab houses and piles of dirt. The landscape is forsaken. “OKC was more than just a city,” Anderson reflects, in the midst of the desolation; “it was an existential crusade, an attempt to assert the primacy of consciousness, of human life, in this endless sea of nothing. It had to keep booming, because whenever it stopped to rest, the prairie rose up and tried to swallow it.” This is the strength, the unlikely triumph, of “Boom Town,” which takes a city almost universally overlooked and turns it into a metaphor for, well, everything.

Anderson is not a native; he had never been to Oklahoma City until he was sent there, in 2012, to write a magazine piece about the Thunder, the city’s improbable — and improbably successful — NBA team. What he finds, though, is not just a basketball story but a kind of vortex.

“Is it possible to control an explosion?” Anderson wonders at the outset, and the question lingers throughout the book. In part, this is because Oklahoma City is itself explosive, a great nothing that out of sheer will spun itself into something, only to flirt with nothingness again. In part, it has to do with what has happened there.

Oklahoma City, after all, is home to catastrophic weather, a city where a meteorologist named Gary England has become a local hero for his tornado forecasts. It is a city that destroys the past as much as it seeks to embody or honor it; downtown was gutted in the 1960s and 1970s in the name of urban renewal, although this has almost entirely failed.

Underneath it all, the longing and disruption, echoes the ghost of the Alfred P. Murrah Federal Building, blown up by Timothy McVeigh on April 19, 1995. “I got to know people in Oklahoma City,” Anderson informs us, “who would tell me everything about their lives, every inch of the deep history of the city, but they could not talk to me about anything they saw on April 19.”

The Oklahoma City bombing was the most destructive terrorist attack in the United States before 9/11; 168 people died in the explosion, including 19 out of 21 children in day care. And yet, for much of “Boom Town” the tragedy is as absent as the negative space where the Murrah building used to stand.

At first, it seems like an oversight, a loose end, something tugging at us from just beyond the page. Anderson, however, knows what he is doing, which is less to create a history of Oklahoma City than to map it out as psychic space. If no one can tell him what they experienced in the tragedy, how can he tell us? The story has to exist in the interstices, to be intuited as much as told.

This is why the Thunder is important; the team’s arrival (it moved to Oklahoma City from Seattle) is not only an emblem of the city’s big-league status but also a sort of reclamation, a way to build upon the past. Every new player is required to visit the memorial, even Oklahoma City native bench player Daniel Orton, who “told the team that, since he had actually experienced the bombing in person, since his mom had been right down near it, since his uncles were firefighters who helped at the scene, since he had been to the memorial a million times, he didn’t feel he needed to take the official tour.” That the team made him do it anyway may be the most telling detail in the book.

What Anderson is tracing is the creation of a narrative, the story the city tells about itself. “I have come to believe, after my time there,” he observes, “that Oklahoma City is one of the great weirdo cities in the world.” The people to whom he introduces us in “Boom Town” bear this out. There is the point guard Russell Westbrook, by turns brilliant and undisciplined, driven by resentment and rage. There is Wayne Coyne, lead singer of the Flaming Lips, still living and working in the neighborhood where he was raised.

Such individuals have more than a little in common with the towering figures of Oklahoma City history: Angelo Scott, who worked to organize the city in its early decades, or Stanley Draper, who arrived in 1919 and, as director of the chamber of commerce, remade the place in his own image for more than 50 years.

They have more than a little in common with Anderson, as well. Like him, they are inside outsiders, who carved a home out of the unforgiving landscape, caught between the structure of the city and the wildness of all that open space. Here, perhaps, we also see the source of Anderson’s affinity for this city built, above all things, on conditionality: “law, fantasy, history; Process, Boom, and a synthesis of the two.”

Boom Town

The Fantastical Saga of Oklahoma City, Its Chaotic Founding, Its Apocalyptic Weather, Its Purloined Basketball Team, and the Dream of Becoming a World-Class Metropolis

By Sam Anderson

Crown. 427 pp. $28