The technologies that power the behavior speculation market, of course, have spread far beyond online ads.

They enable auto insurers to surveil drivers and offer discounts based on their driving performance. They allow workplace wellness programs to charge higher health insurance premiums to employees who decline to wear fitness trackers. They helped Kremlin-linked groups mount political influence campaigns on Facebook (although, as my colleague John Herrman pointed out this past week, we have yet to learn how effective those campaigns were).

The flash-trading in human behavioral data was not inevitable.

In her book, Dr. Zuboff describes how Google, in its early days, used the keywords that people typed in to improve its search engine even as it paid scant attention to the collateral data — like users’ keyword phrasing, click patterns and spellings — that came with it. Pretty soon, however, Google began harvesting this surplus information, along with other details like users’ web-browsing activities, to infer their interests and target them with ads.

The model was later adopted by Facebook.

The companies’ pivot — from serving to surveilling their users — pushed Google and Facebook to harvest more and more data, Dr. Zuboff writes. In doing so, the companies sometimes bypassed privacy settings or made it difficult for users to opt out of data-sharing.

“We saw these digital services were free, and we thought, you know, ‘We’re making a reasonable trade-off with giving them valuable data,’” Dr. Zuboff told me. “But now that’s reversed. They’ve decided that we’re free, that they can take our experience for free and translate it into behavioral data. And so we are just the source of raw material.”

Of course, tech companies tend to bristle at the word “surveillance.” They associate it with government spying on individuals — not with their own snooping on users and trying to sway them at scale.

“When organizations do surveillance, people don’t have control over that,” Mark Zuckerberg, Facebook’s chief, said in April during a Senate hearing on Cambridge Analytica, the voter-profiling company that improperly harvested the data of millions of Facebook users. “But on Facebook, everything that you share, you have control over.”