In the late 1990s Carole Hooven, an evolutionary biologist at Harvard, was researching chimpanzee hormone levels in Uganda when she observed that Imoso, the troop’s “mayor,” let loose on females, particularly Outamba, kicking and drubbing her with his fists until she bled. Although primatologists had long documented bellicosity in chimps, our closest cousins, Ms. Hooven was still shocked, kindling a desire to plumb the organic underpinnings of this behavior.

In her clear-eyed, crisply written “T: The Story of Testosterone, the Hormone That Dominates and Divides Us,” Ms. Hooven does that, and so much more. In the intervening decades the ground has shifted: the Human Genome Project compiled our vast DNA alphabet, the Supreme Court federalized same-sex marriage, and victims of sexual assault, in a crescendo of rage and shame, forced a public reckoning. She deftly threads the needle of social ferment with her own imperatives as a scientist, exploring the “molecule of masculinity,” coded by SRY, a runt of a gene found on the Y chromosome, but one that packs a wallop.

“T” does what all superb popular science must do: It entertains as it educates. Ms. Hooven depicts endocrinology’s origin in the 19th century, when Arnold Berthold, a German academic, sewed testes into the abdomens of castrated cockerels. The physiologist Charles-Édouard Brown-Séquard went a step further, injecting himself with the extracts of crushed testes harvested from guinea pigs and dogs. Ms. Hooven also weaves in other historical figures, among them the eunuchs of China’s Qing dynasty and the castrati of Baroque Italian choirs.

The discovery of testosterone in the early 20th century brings the narrative into a sharper scientific focus. Ms. Hooven surveys the data on T, distilled from a broad literature—for example, the hormone exists in both sexes but is 10 to 20 times greater in men. She conveys her arguments in folksy metaphors, comparing gene action in fetal development to a recipe for chocolate-chip cookies: “The gene for Jenny’s androgen receptor had a tiny typo, but the results were more consequential than misprinting ‘three eggs.’ It’s as if ‘two cups flour’ were misspelled ‘two cups fluor.’ Fluor is a mineral containing the element fluorine, and is worse than useless for baking.”

“T” roams widely, as Ms. Hooven details the rutting rituals of red deer on Rum, a craggy island off the coast of Scotland. High-T stags triumph in the clash of antlers, passing along their genes. By contrast Ms. Hooven delves into the career of the serendipitously named John Wingfield, a British biologist who studied song sparrows. These birds’ testosterone spikes as they woo females with their warbles; after the brood hatches, the fathers are involved in the care of their chicks, dialing down their T. When Wingfield increased testosterone in a group of males that had been busy gathering food for the nest, the results were dramatic. “High-T dads went out singing at all hours along the perimeter of their territories, telling the neighbors to screw off and trying to score new females.” Chicks fathered by these hormonally revived playboys were more likely to starve.

Ms. Hooven plumbs the dimorphic nature of sex, but she’s also incisive in her exploration of atypical development, like complete androgen insensitivity syndrome, or CAIS. “An individual’s sex isn’t always consistent with its sex chromosomes. What matters most is the particular pattern of gene expression that leads to the development of testes and ovaries,” she writes, with a passion that reveals itself in italics. “When I learned that there are two clusters of cells that could, even at six weeks, go on to form either ovaries or testes, and then others that could form either the vagina or penis, I felt a sense of awe at the efficiency of natural selection . . . I also felt a profound sense of connectedness to the other sex. We are made from almost the exact same stuff.”

That almost offers up a rich narrative ore, which Ms. Hooven mines with relish. A male fetus is bathed in testosterone between eight and 18 weeks of gestation, just after the gonads differentiate; a male infant undergoes a “mini puberty” in the first months of life; later, a hormonal surge molds his body during puberty, thickening muscles and dropping the voice. Females are occasionally exposed to higher levels of T in utero, which can map to same-sex attraction. (As Ms. Hooven notes, there’s no discernible association between T and male sexual orientation.)

Ultimately, “T” is a vigorous defense of the scientific method itself. Ms. Hooven summarizes: “Multiple independent sources of evidence can combine to strongly support a hypothesis, whether it’s about the cause of a rattle in your car, why your soufflé has collapsed, or why someone blocked you on Twitter. It’s just like that in science.” She does not shy away from hot-button topics, such as puberty blockers, the flux of T in female athletes, or the distressing links between testosterone and aggression in men. (For genetics geeks there’s a tantalizing riff on the “CAG repeat,” which may signal a predisposition to violence.) But she’s emphatic that high T levels do not lead inexorably to rape and murder; mountains of data disprove this fallacy. She also gives testosterone its due: Men are far more likely “to put their lives on the line for others, and are massively overrepresented in the most dangerous occupations.” She lauds the men who protected her while she conducted fieldwork in the jungles; heroism, for her, thrives at the molecular level.

Decades ago, Ms. Hooven vowed to make testosterone her life’s work: “I longed to understand men.” In her final chapter, she circles back to her own story, speaking to us intimately, casting her intellectual journey in a luminous chiaroscuro (no spoilers). Her book confronts ugly truths about male behavior, but also seeks to reintroduce nuance into our discourse by enlarging our grasp of the biological processes shaped by testosterone. “T” is a gorgeous culmination of an odyssey both professional and personal.

Mr. Cain is the author of a memoir, “This Boy’s Faith: Notes From a Southern Baptist Upbringing.”