“Jim, this certainly sounds strange coming from me, but I was a constant critic of Wall Street,” Bernie Madoff told me once. “I was a product of the corrupt culture of Wall Street.”

In the 12 years I spent interviewing all the members of the Madoff family for my book Madoff Talks, publishing later this month, I uncovered what felt like an endless stream of shocking and little-known revelations.

Alongside a leading, innovative, fully legitimate market-making business, Madoff, who died Wednesday in federal prison at age 82, built the biggest criminal enterprise in Wall Street history. On the other hand, he built from scratch what became the third-largest market-maker, democratizing Wall Street, breaking down the monopoly of the New York Stock Exchange, and executing trades for discount brokers such as Schwab in what was probably a onetime legitimate firm with ethics beyond the Wall Street norm and worth $3 billion without any Ponzi scheme.

(In an indicative aside, his administrative assistant in the legitimate business made $125,000 with no I.R.A., while his administrative assistant in the Ponzi scheme made $670,000 and had a $58 million—albeit fake—I.R.A. Go figure.)

Not only did he build an honest business, Madoff seemed to genuinely care for his employees, paying for sudden medical expenses and honeymoons. And he certainly wasn’t ignorant enough to know the effect of his $65 billion Ponzi scheme on the thousands of unsuspecting charities and pensioners asking him to manage their wealth, though he often expressed resentment toward his victims, who he felt were greedy and relentless in their pressure that he produce positive returns.

How did he balance the genuine caring with the apparent lack of empathy?

I realized early on that Madoff was a master at compartmentalization. He ran the Ponzi hidden away on the 17th floor of his Midtown Manhattan headquarters, where the small, purposely unsophisticated staff never figured out that the dirty work they were doing was facilitating a giant fraud. Madoff’s sons, Mark and Andrew, who worked at their father’s company, were never even granted keycard access to the 17th floor.

“I was a product of the corrupt culture of Wall Street.”

Bernie made money on commissions in the legitimate business, whether stocks went up or down. With the Ponzi hedge fund, he was obviously exposed to losses—something he couldn’t stand. So he simply stopped trading and made up his results. He even resorted to sex, carrying on several affairs with his investors that were thought to have been more about control than lust.

Despite five separate investigations, the S.E.C. failed to detect the Ponzi scheme, or even that Madoff was running an illegal hedge fund. Over 40 years, the S.E.C. missed what could have been uncovered in a well-placed five-minute phone call to a Wall Street trade-validating entity.

And JPMorgan Chase, Madoff’s bank, held the assets of Madoff’s Ponzi hedge fund, yet somehow it never knew the account was for the hedge fund, assuming it was for the legitimate market-making arm of the company. Nor did the bank, which had the most transparent insight into Madoff’s finances, notice that there was not a single payment for a trade counter-party—a glaring red flag that no real investment activity was likely going on.

Naturally, my biggest question in all of this was whether the family, who were never charged, knew. The F.B.I. was convinced that Mark, Andrew, and Ruth Madoff (Bernie’s wife) had been complicit. I was the only one to get inside the family, and knew things the feds didn’t. My investigation was touch and go on what they knew and when they knew it.

Madoff’s administrative assistant in the legitimate business made $125,000 with no I.R.A., while his administrative assistant in the Ponzi scheme made $670,000 and had a $58 million—albeit fake—I.R.A. Go figure.

It didn’t take long in my interviews with Ruth Madoff for me to realize she was devoted to Bernie to the extent that he exercised an almost cult-like control over her. I found she was still balancing the infamous JPMorgan Chase bank account for the fraud even as late as a year before the Ponzi scheme crashed. Yet, as she told me at one point over a series of lunches, her first words after Bernie finally admitted to the fraud one day before his arrest were “What’s a Ponzi scheme?”

Andrew and Mark moved to turn their father in immediately after Bernie’s sudden confession, not pausing to move their money, cover up, or flee. On the other hand, the forensic lead on the subsequent investigation uncovered that Madoff had laundered hundreds of millions of dollars from the Ponzi scheme into the back door of the market-making business to prop it up.

Mark hanged himself in 2010, on the second anniversary of his discovery of his father’s fraud, and Andrew died of cancer in 2014. Only Ruth, who lives in Old Greenwich, Connecticut, survives.

Twelve years later, is Wall Street destined to repeat history? Just look at Robinhood, with a business model in conflict with its customers, earning payments for order flow that, until the S.E.C. sanctioned them, resulted in inferior trade-execution prices such that their customers would have been better off paying commissions to competitors and getting lower prices on trades. Madoff practically invented payment for order flow, but he never abused it in the way Robinhood did. Rather than a new-age electronic broker, Robinhood has morphed into an age-old vehicle for “pump and dump” from social media hyping bad companies, which can only end badly for its retail investors.

In the under-regulated, over-leveraged hedge-fund world, family office Archegos Capital Management blew up almost overnight due to excessive leverage from derivatives, which had obscured the size of the portfolio, spurred margin calls at distressed prices, and cascaded into potentially de-stabilizing losses at Wall Street firms. The firm’s C.E.O., Bill Hwang, went from being worth roughly $20 billion to basically zero.

The more things change, the more they stay the same.

Jim Campbell is the host of the Business Talk with Jim Campbell and Forensic Talk with Jim Campbell radio shows. His book, Madoff Talks: Uncovering the Untold Story Behind the Most Notorious Ponzi Scheme in History, publishes April 27 from McGraw Hill