If you want to understand how the stock market operates on a daily basis, find a big board with a large number of stock quotes and simply watch it. What I suspect you'll find is that stocks move in tandem. One second, they seem to be skirting about randomly. The next, a wave of red or green overtakes over the board. This isn't a coincidence.

In the new and highly entertaining book Automate This: How Algorithms Came to Rule Our World, Christopher Steiner shines a welcome light on the forces at work here: computer algorithms. "The bounds of algorithms get pushed further each day," says Steiner. "They're faster than us, they're cheaper than us, and, when things work as they should, they make fewer mistakes than we do. But as algorithms acquire power and independence, there can be unexpected consequences."

Unexpected consequences is right...
Halfway through the day on May 6, 2010, there was hardly anything unusual going on in the markets. Stocks were down a non-notable 2.5% on news that riots had erupted in Greece protesting proposed spending cuts by the government.

In the flash of an eye, however, what was an otherwise typical down day transformed into an all-out rout. In the five minutes between 2:42 p.m. and 2:47 p.m., the Dow Jones Industrial Average (^DJI 0.06%) tumbled by more than 700 points, to nearly 1,000 points lower, momentarily extinguishing $1 trillion of wealth.

If you happened to be watching CNBC at the time, then you likely haven't forgotten what transpired -- if you weren't, here's the coverage. A company as sound and storied as Proctor & Gamble (PG 0.86%) lost almost a quarter of its value, falling from $61 to roughly $47 over the course of a couple minutes. Steiner captured Jim Cramer's response:

"It can't be there. That is not a real price," Cramer proclaimed exasperatedly. Then, indignantly, he barked, "Okay, just go buy Procter." He wheeled to look directly at the camera, imploring viewers, "Go buy it right now. Just buy it!"

Steiner at his best
While retail investors may never know exactly what caused the market to "flash crash" on that day, it seems safe to assume that the event was a machine-fueled phenomenon. And it's here where Steiner is at his best.

Steiner traces the use of algorithms on Wall Street back to the late 1960s, or what he calls, "phase zero of the algorithm story." In 1969, a Hungarian-born and self-taught computer programmer named Thomas Peterffy landed a job at Mocatta Group, a commodities trading operation based in Chicago.

It was here over the next few years that Peterffy developed and then implemented the first so-called black box, which inhales market data, processes it, and then outputs instructions on what to trade and when to do so. And the rest, as they say, is history.

Over the proceeding chapters, Steiner goes on to discuss in equally vivid detail how the use of algorithms has since spread to other fields. Among other things, he discusses how algorithms help the music industry identify future stars and the medical profession match organ donors and recipients.

Invariably, however, Steiner is drawn back to its now-oversized influence on Wall Street at firms like Goldman Sachs (GS -0.20%), Morgan Stanley (MS 0.20%), and Bank of America (BAC 1.53%), among others.

So what's the lesson, asks Steiner: "Get friendly with bots."

The Foolish bottom line
At the end of the day, if you're interested in investing and want to understand the history of algorithms and the role they currently play in the market, as well as their likely future role, this is a must-read.

For another must-read, check out our in-depth report on Bank of America, which detail why its stock could "double or triple over the next five years." To access your own copy today, simply click here now.