THE Jesuits, the US Marines and the Freemasons: McKinsey has been compared to them all, at one time or other. The firm prides itself on being the most prestigious management consultancy, sending out its bright, young footsoldiers to advise executives and policymakers on tricky strategic issues. It is everywhere, counselling 90 of the top 100 firms (as ranked by Forbes magazine). Among its many government assignments it is helping Britain to leave the EU, Lebanon to fix its economy and the Saudis to wean themselves off oil.

Occasionally the company needs new leadership itself. On February 25th the result of a long election process was made public. Kevin Sneader, the Scottish chairman of McKinsey’s Asia unit, will replace Dominic Barton as managing partner—the top job. He inherits a thriving business. The firm remains by far the biggest of the premium consultancies (see table). Over the past decade, annual revenues have doubled to $10bn; so too has the size of the partnership, to more than 2,000.

The firm has also overhauled its own operations in many respects. Mr Barton claims that half of what it does today falls within capabilities that did not exist five years ago. It is working to ensure that customers turn to McKinseyites for help with all things digital. It has had to make acquisitions in some areas: recent purchases include QuantumBlack, an advanced-analytics firm in London, and LUNAR, a Silicon-Valley design company. It is increasingly recruiting outside the usual business schools to bring in seasoned data scientists and software developers.

Staying relevant to big tech firms is not easy, however. McKinsey has kept plenty of older ones as clients, such as Hewlett Packard, but it has a lot more to do to crack new tech giants and unicorns (private startups worth more than $1bn). In general, management consultancies have made fewer inroads into firms such as Facebook and Google. That is partly because consultants typically help struggling firms cut costs; they have less appeal to firms already on the cutting edge. Cash-rich tech firms also tend to prefer keeping things in-house rather than bringing in consultants. They compete with McKinsey in some ways, too. Amazon has become the largest recruiter at some business schools, and the firm’s own consultants are lured away by tech firms’ generous pay packages.

McKinsey’s response is to try to gain a foothold earlier on in tech firms’ life-cycles. It is targeting medium-sized companies, which would not have been able to afford its fees, by offering shorter projects with smaller “startup-sized” teams. As it chases growth, the firm is also doing things it used to eschew as being insufficiently glamorous. In 2010 it moved into business restructuring and it has also set up a global strategy “implementation” practice. That is a far cry from the days when its consultants stuck mainly to blue-sky thoughts in their ivory towers. Mr Barton has also overseen a shift towards a results-based fee model, bringing the firm into line with its nearest competitors, the Boston Consulting Group and Bain & Company.

As McKinsey takes on more people and practices, cracks in its distinctive “One Firm” ethos, and its reputation for discretion, might start to show. It is under investigation in South Africa for working with Trillian, a local consulting firm owned by an associate of the controversial Gupta family, on a contract worth hundreds of millions of dollars for Eskom, a state-owned utility. The firm says it never worked for the Guptas, but admits to “errors of judgment”, particularly in starting work with Trillian before its internal due diligence was complete. The fallout so far has been limited to South Africa, with a few local clients, including Coca-Cola’s local unit and some banks, saying they will not give McKinsey any new work.

Events in South Africa may be an aberration, rather than a consequence of rapid growth. But the tension between profit and principle is not new. It manifested itself most clearly when Rajat Gupta, a former managing partner, was convicted of insider trading in 2012. Can McKinsey continue to grow rapidly while keeping its key asset—its reputation as a trusted adviser—intact? Now there is a question worthy of the world’s best consultants.