In John Grisham's 1991 novel The Firm, the legal company at the heart of the story turns out to be an outpost of an organised crime empire. The crooked organisation is ultimately bust open by the FBI.

In Duff McDonald's comprehensive new history of the consultancy firm McKinsey, also tantalisingly called The Firm, there is no such messy reckoning for the company at the heart of the story, nor any criminality. McKinsey plainly isn't the mafia, but a central question is nevertheless posed by Mr McDonald's book: how do these guys keep getting away with it?

McKinsey's fingerprints can be found at the scene of some of the most spectacular corporate and financial debacles of recent decades. The energy-trading firm Enron was the creation of Jeff Skilling, a proud McKinsey consultant of 21 years. But this wasn't guilt by association. Enron, under Mr Skilling, was paying McKinsey $10m (£6m) a year for advice. McKinsey fully endorsed the dubious accounting methods that caused the company to implode in 2001.

The consultancy also advised virtually all of the Wall Street banks in the unprecedented credit boom of the past decade. Its consultants, as Mr McDonald chronicles, actively promoted the securitisation of mortgage assets, the practice that poisoned the global financial system and precipitated the 2008 credit meltdown.

The firm also encouraged the banks to fund their balance sheets with debt, driving down their equity safety buffers in order to juice profits.

Personal corruption has touched the highest echelons of McKinsey. The firm was headed for 10 years by Rajat Gupta, who was convicted in the US for insider trading in 2012. Mr Gupta passed on confidential information on corporations to a billionaire hedge fund friend. Mr Gupta had left the firm when he committed his crimes, but another senior serving McKinsey partner was also involved in the ring of insider dealing.

Yet McKinsey somehow keeps bouncing back. The firm's revenues have carried on growing, despite the succession of scandals, reaching an estimated $7bn in recent years. Its corporate customers have proved remarkably forgiving. The commissions keep rolling in. One of the first acts of the new Bank of England Governor, Mark Carney, was to call in McKinsey to review the central bank's operations, at an undisclosed cost. In the 2012 US presidential election (the same year Mr Gupta was convicted) the Republican candidate Mitt Romney talked of his intention to hire McKinsey to "fix" the American government.

Mr McDonald tells the McKinsey story in an accessible way. He does a good job of exposing the staggering self regard. "There are only three great institutions left in the world: the marines, the Catholic Church and McKinsey," boasts one partner. Others can be heard referring to themselves as "the greatest collection of talent the world has ever seen".

The author also reveals the delusion that saturates the firm. "It's almost never that we fail because we come up with the wrong answer. We fail because we don't properly bring along management," explains one partner. "We literally saved Glasgow," boasts the consultancy's British boss after doing some work for the city. And Enron? "It was a great business that just got out of hand."

Mr McDonald shines an edifying light on Arch Patton, a McKinsey consultant in the 1950s, who was a tireless promoter of higher pay for America's corporate bosses. At one stage Mr Patton alone accounted for a tenth of the firm's billings. The executive gravy train, whose engine Mr Patton helped to construct, is still clattering on today.

McKinsey partners, too, have become very rich. They famously bill vast sums for their services, more even than other consultancy firms. Are they worth it? On this point Mr McDonald equivocates. Though he outlines the negative case, he also suggests that since McKinsey has been around since the 1920s and keeps getting hired it must be doing something right. Yet this might be a case of the emperor's new clothes. Which chief executive is likely to admit he has wasted money on overpriced consultants, or failed to benefit from the advice of the world's brainiest people?

McKinsey has, Mr McDonald argues, "certainly made the world a more efficient, rational and objective place than it might otherwise have been". Maybe. But he fails to identify a single major technological or commercial development that McKinsey can claim even some passing credit for bringing into the world.

In the end, the impression left is that consulting is a kind of confidence trick played on that small and isolated stratum of humanity who head multinational companies. Since consultants work for a range of firms in a sector they can seem (whether this is true or not) like a useful source of information on what direct rivals are up to. Can you afford not to hire them, wonder the bosses? If everyone else is getting them in, shouldn't you too?

But this, ultimately, underlines their peripheral importance. The truth is that McKinsey is not the global economy's powerbroker. Mr McDonald calls the network of McKinsey alumni "the most powerful the world has ever seen". A glance at the list of ex-Goldman Sachs employees in positions of power and influence – from Mario Draghi at the European Central Bank to Mark Carney at the Bank of England – is enough to rebut that proposition.

Criticism of the firm too, can be overstated. McKinsey didn't cause the credit meltdown, or the Enron blow-up; it just partly facilitated them. McKinsey blessed the actions of incompetent and greedy managements with their slick charts and beguiling jargon. Similarly, when they recommend job cuts they are, often, simply telling bosses what they want to hear.