The average grocery stocks 32,000 distinct products. Browsing the aisles consumes 2 percent of our lives. It is possible to attribute the breakthrough popularity of bibimbap circa 2015 to precisely seven factors. Shrimp farmers can increase yield by severing one of each female’s eyestalks.

You may not have been aware of these factoids. But I’d wager that every time you’ve wheeled a cart across the threshold of a supermarket, you have sensed their power. When you stand before the teeming arrays of cereals and shishito peppers in the average megamart, you understand that they are made possible by staggering feats of logistics, by the mad science of Big Ag and the marketing genius of the snack-industrial complex.

The “dark miracle” of the modern American grocery store is the subject of Benjamin Lorr’s new book, “The Secret Life of Groceries,” which would have cleared the fascination bar even before the panic shopping of early Covid reminded us not to take these spectacular behemoths for granted. The subject is sprawling, and Lorr spent five years filling up his reportorial cart: debriefing grocerymen, eating his way through specialty food expos, riding shotgun with a long-haul trucker, even working undercover in the seafood department of a downtown Whole Foods. (There is a nonzero chance I bought a pound of salmon from him in the winter of 2015.)

The process left Lorr horrified and awed, often at the same time. You might imagine that of the five senses, taste and sight would be the most frequently invoked in a book about groceries, but Lorr’s book hits you hardest through the nose. He opens with the unforgettable stench of an upscale seafood display case getting its once-every-two-months deep clean. “It is horrible and not at all of decomposition but of fecal waste maybe sweetened slightly,” Lorr writes. He ranks the smell the worst of his research, out-reeking the times he waded through the waste lagoons of industrial swine farms and stood ankle-deep in rotting fish on a 90-degree day in Thailand.

Lorr, though, is not on an Upton Sinclair quest to nauseate readers into changing their consumption habits. Instead, “The Secret Life of Groceries” is a deeply curious and evenhanded report on our national appetites.

Lorr takes a U.S. Department of Agriculture class on avian influenza — a class he describes as “basically co-produced by Tyson Foods, the very definition of propaganda” — and then tags along as an animal rights group infiltrates an egg factory. “I saw terrible, weird things,” Lorr writes, “but I left just as I entered: capable at moments of seeing it like the U.S.D.A. slides and capable of seeing it like the vegans. It was not filthy, nor a hellscape. It was instead an intensely alien, highly functional place for animals to live a sad short life before they were set to die.” Similarly, after detailing the U.S. food safety regime — it’s an awkward combination of underfunded regulators, mercenary tort lawyers and dubious private auditors — Lorr concludes that the haphazard system works. Our hamburgers are pretty safe.

I started “The Secret Life of Groceries” expecting that more of it would take place within the four walls of supermarkets. But Lorr’s more far-flung chapters, tracing supply chains and labor practices, yield characters rendered more richly than you often get in the pop-biz genre. There’s Lynne, a monologue-spewing trucker with an unfaltering work ethic and delightfully crude manners. (She spends the first moments of their acquaintance assessing what size Gatorade bottle Lorr will need for on-the-highway bladder relief: “Nothing in those pants looks like you’re a wide-mouth anything.”) And there’s Julie Busha, a condiment entrepreneur, whose chipper determination to make combination salsa-coleslaw a thing nearly made me believe in American exceptionalism.

Lorr has considerably less empathy for supermarket shoppers in general, whom he describes as “skittish and insane.” We insist on impossible standards of quality, price and availability, then get outraged by the manner in which industry meets those demands. If our grocery stores and the systems that supply them are grotesque, it’s because we have asked them to be.