The Silicon Valley start-up that conquered web search, mastered online advertising and built a self-driving car now faces a challenge it may not be able to solve: how to win in China without losing its soul.

Twenty years after its founding, Google sits in an enviable position by almost every measure – with record profits, a supremely talented workforce, billions of dollars in excess cash on hand, and dominant market share in most of the world.

But in its mission to “organise the world’s information and make it universally accessible,” Google has had minimal impact in the largest market on earth: mainland China and its nearly 800 million internet users.

All the tools – and weapons – China can use for global tech dominance

This has long flummoxed Google’s founders Larry Page and Sergey Brin, who see China as a font of future profits, certainly, but also as a deserving beneficiary of the information revolution they have helped bring about worldwide.

Under CEO Sundar Pichai, Google is going after China head on, albeit with a typical Googley mix of secrecy and intrigue. According to media reports that draw on confidential internal documents, the company is now developing a search engine and news aggregation app that will comply with the Chinese regime’s strict censorship laws. The closely guarded project, code-named Dragonfly, adds to recent moves Pichai has made towards China including the creation of an artificial intelligence lab in Beijing, investments in Chinese companies, and meetings with top Communist Party officials.

Internal Google message boards reveal that some employees feel stung by Dragonfly; several have transferred to other roles or quit rather than work on the project, which they view as a “censorship engine” and a betrayal of the company’s ethics. Other employees noted, however, that boycotting China did little to change the situation.

Google has of course tried to set up shop once in China already, and retreated. In 2006, after an intense months-long debate inside the Googleplex, the company announced that it would launch a censored version of its search engine in China, rationalising that it was better to abide by the government’s restrictions than not serve Chinese users at all. “We even did an ‘evil scale’,” said then CEO Eric Schmidt, referencing the company’s unofficial motto, “Don’t Be Evil.”

Why Hong Kong’s plan to attract the next Google is a great leap backwards

This initial foray into China was a big deal for Google’s founders, who had poached famed computer scientist Kai-fu Lee from Microsoft to run its China operation, weathering a legal challenge from its tech rival and a barrage of media criticism. Brin always seemed uneasy with the decision – he admitted that Google had “compromised” its principles – and he ultimately drove the company’s decision in 2010 to abandon its censored service. Brin said that China’s surveillance operations had the “same earmarks of totalitarianism” as Soviet Russia, from where his family had fled decades earlier. The final straw then was China’s repeated hacking of Google email accounts belonging to dissidents. Censorship and surveillance by the regime have only worsened under President Xi Jinping, according to human rights groups, so the question must be asked: Is there anything that warrants the dramatic policy shift to once again abide by website blacklists and censorship?

Money, naturally. But that’s not all.

Fighting cancer in Singapore, eating plastic in Indonesia: is Southeast Asia the next Silicon Valley?

Google is a high-flying business with an insatiable appetite for further growth, and China represents one-fifth of the world. Yet it is a mistake to view Google’s ambitions in China as pure greed. For all its capitalistic heft, the company has never been solely driven by profit, a reflection of its founders’ ethos. Witness the lack of ads on the Google homepage, perhaps the most valuable real estate on the entire web.

A desire to build and deploy world-changing technological innovations like self-driving cars and energy-harvesting kites is part of Google’s calculus too. China’s huge market is important for scaling some of the biggest capital-intensive projects.

And then there’s talent. Google executives are without doubt looking east for the next generation of engineering talent, particularly in AI, where China is already very competitive globally. To attract the pool of scientists and technologists that will fuel its next 20 years, Google needs to enhance its presence and boost its brand name.

“Many young people in China have little idea what Google, Twitter or Facebook are, creating a gulf with the rest of the world,” noted The New York Times this week, a stark reminder of the consequences of sustained censorship. Google’s search engine, news aggregator and other consumer apps, if approved, will begin to bridge that gulf and put the US firm on the map alongside Baidu, Alibaba, Tencent and the wave of young start-ups that inevitably will pine for the thousands of top graduates each year.

Is Asia Spotify’s weak spot?

Will Google ever crack into Baidu’s dominant market share in search? It may not matter. With 800 million users, Google can profit handsomely by stealing only a fraction of the market, provided it manages to stay on the good side of the censors.

Which brings us back to the billion-dollar question. Is Google striking a Faustian bargain in returning to China? The company is sure to face intense scrutiny from US lawmakers, who will undoubtedly ask why the company declines AI projects for the US military while allowing them for Communist China’s censorship regime. Google employees will be listening closely to the answers. Better pull the “evil scale” out of storage.

Mark Malseed is co-author of The Google Story and a co-founder and executive at the media intelligence firm Synoptos