They didn’t like the West’s playbook. So they wrote their own.

At Huining No. 1 High School, the pressure is on to excel on college entrance exams. Gilles Sabrié for The New York Times

As China grew richer, the West assumed, political freedoms would follow. Now it is an economic superpower — and the opposite has happened.

In the dusty hillsides of one of China’s poorest regions, Gong Wanping rises each day at 5:10 a.m. to fetch well water and cook her son’s breakfast. She washes his feet while he keeps his nose in English and chemistry books. She hits him if he peeks at her cellphone.

To Ms. Gong, 51, who dropped out of school, the future of her son, Li Qiucai, 17, is paramount. If Qiucai does well on the college entrance exam, if he gets a spot at a top university, if he can achieve his dream of becoming a tech executive — then everything will change.

“He is our way out of poverty,” she said.

To achieve all this, Ms. Gong and millions of other Chinese like her have an unspoken bargain with the ruling Communist Party. The government promises a good life to anyone who works hard, even the children of peasants. In exchange, they stay out of politics, look away when protesters climb onto rooftops to denounce the forced demolition of their homes, and accept the propaganda posters plastered across the city.

Ms. Gong is proud of China’s economic success and wants a piece of it. Politics, she said, doesn’t matter in her life. “I don’t care about the leaders,” she said, “and the leaders don’t care about me.”

How China became a superpower

For years, many Western analysts believed the Chinese people, having endured decades of hardship under Mao, would tolerate one-party rule in exchange for rising incomes and more social freedom until the day — or so the argument went — that a newly prosperous nation would demand political freedoms, too.

Instead, the opposite has happened. Income levels have jumped, yet China’s authoritarian leaders have consolidated power. President Xi Jinping could be a ruler for life. China’s people still place demands on the party, but the old assumption that prosperity inevitably stirs democratization is being challenged.

It turns out that the unspoken bargain that binds Ms. Gong and others to the state is more complicated. It resonates, in part, because China is still intent on addressing the questions that it asked itself one century ago, before the Communist Revolution in 1949: What made it so weak and held it back as the West advanced? And what did it need to do to get ahead?

If Li Qiucai is determined to get into a top college, his mother, Gong Wanping, may be even more so. She checked on him while he was studying during a lunch break. Gilles Sabrié for The New York Times Students read aloud from textbooks so they can memorize them. That’s just a warm-up before the start of class. Gilles Sabrié for The New York Times

Back then, the blame was placed on a conservative traditional culture that emphasized hierarchy, discouraged individual initiative and rewarded knowledge of Confucian classics over more practical topics like mathematics and science. The Communists sought to smash that culture through Marxist-inspired policies, but that ended in disaster.

Yet China’s leaders, and its people, have continued to look for answers, as the party crafts new ones that build on and reshape traditional culture without rejecting it entirely.

The government has offered education as a path to social mobility, unleashed private enterprise by removing Confucian and Marxist stigmas against the merchant class and cultivated a potent brand of nationalism, blending pride and humiliation into a narrative of restoring Chinese greatness.

But for many Chinese, those incentives are only part of the calculation. So, too, are the costs of rejecting the party’s bargain.

Over the years, the party has expanded its repressive capabilities.

For some, like the ethnic minority Uighurs in Xinjiang, the country’s turn toward hard-nosed authoritarianism has meant the devastation of entire families, cultural and religious practices and ways of life. For others, just the fear of repression is enough to keep them in line.

It is impossible to know how many Chinese disapprove of the system. In private, many middle-class Chinese have voiced frustrations with, for example, Beijing’s handling of the growing trade war with the Trump administration. But few dare to speak out.

Memories of famine and political upheaval have shaped Ms. Gong’s generation and are passed down in the form of whispered warnings: China has too many people. China is not ready for democracy. Stay out of politics. Don’t ask questions.

But so far, frustrations and fears have been overshadowed by the surge in pride — and the sense of opportunity — that has come from seeing the motherland’s rise.

Once, the allure of the West was considered irresistible; now many Chinese educated in Europe or the United States have returned, eager for their children to know a China that is proud and powerful. James Ni had a chance to study in America but instead remained in China and became a multimillionaire. Hua Yijia, a venture capitalist in Beijing, studied and worked in America but wants her 8-year-old daughter to take pride in being Chinese.

“I want her to understand the beauty of the language and the hard work and sacrifices of the people, especially in the countryside,” Ms. Hua said. “China used to be a very backward country, but her generation will have so many more opportunities.”

Many analysts and Western diplomats are now confronting the likelihood that so much of what they assumed about how China would change — and become more like the West — is turning out to be wrong.

“The Chinese mentality is very practical,” said Xu Zhiyuan, a Beijing-based historian and writer. “From a young age, you are told not to be idealistic, you are told not to be different. You are encouraged to survive, to compete, to excel within the system.”

“The whole society is a competitive playground.”

The Chinese Dream

It was Aug. 9, exactly 302 days until the college entrance exam, and Li Qiucai was frantic.

In the halls of Huining No. 1 High School, in the northwestern province of Gansu, teachers were already turning up the pressure. The school is a powerhouse in producing rural students with top test scores, and teachers urged Qiucai to preserve the school’s reputation and “shine like the sun.” Signs posted in the hallways warned that students must tolerate a little pain now to avoid a “life of suffering.”

Since Qiucai began attending the school two years ago, his life has been a blur of late-night cram sessions, practice tests and mastering the art of finishing geometry problems while slurping noodles. He starts each day by running around a racetrack chanting, “The heavens reward industrious people!”

He attends classes until almost 10 p.m., with only a short break on Sundays, and lives nearby in a $32-a-month apartment with his mother, who cooks and cleans so that he can study full time.

All of it is pointed toward next June, when Qiucai will be one of nine million students taking a test that is at the core of China’s high-stakes meritocracy — those who perform best get a ticket to the Chinese dream.

“Only if I do well on the test,” Qiucai said one recent night as he worked on physics problems, “can I have a better life.”

Education means more than ever for Chinese who want to better their lot. Parents waiting for their children to finish the college test. Visual China Group, via Getty Images It’s all about the gaokao. A motivational rally ahead of the entrance exam. Visual China Group, via Getty Images

Perhaps nothing is more linked to social mobility in China than education, especially the college entrance exam, known as the gaokao. At Huining No. 1, graduates who have won admission to China’s top universities return each summer as living proof of the dream, sharing their experiences and imploring students like Qiucai to work even harder.

Yet if the gaokao is a symbol of opportunity, it is also a tool of social control. Scholars say it is a clever governing tactic borrowed from the keju, the Confucian examination system that determined the selection of government officials in China for more than 1,300 years. Even in dynastic China, the keju lent the government an aura of meritocracy, as it was open to all men. But only 1 percent of applicants passed the exam for the highest degree, since few had the time and money to prepare.

In a modern China rife with corruption, the gaokao is seen as relatively fair and incorruptible, meaning that those who fail are unlikely to blame the government.

“It allows the government to say: ‘If you are not successful, you can only blame yourself. You did not work hard enough,’” said Yong Zhao, an education professor at the University of Kansas. “That is a very powerful way of governing.”

The gaokao was established in 1952, under Mao, and initially only students with class backgrounds deemed suitably red were allowed to apply. The test was suspended during the Cultural Revolution — the turbulent period in which teachers were beaten and schools shuttered — and then restored in 1977, after Mao’s death. More than 10 million students rushed to take the exam, which was now more meritocratic, and open to almost anyone.

In the decades since, the spread of basic literacy and numeracy, and the cultivation of top technical talent, have resulted in immeasurable economic gains. But the gaokao has contributed to concerns that China’s education system overemphasizes rote memorization and instills values of obedience and conformity, not critical thinking.

For the Communist Party, the surge in high school graduates has also increased pressure to provide employment — and brought rising complaints that the system still places rural students at a disadvantage. Admission quotas at universities still greatly favor urban elites, and secondary education in the rural areas is lagging. And even as schools like Huining No. 1 keep students focused on the gaokao, a rising number of graduates struggle to find work and repay college loans.

So some are opting for another way to get ahead: They apply to join the Communist Party.

Love, Not Marriage

James Ni is fine with not being a member of the Communist Party. He is a fabulously wealthy private entrepreneur whose company, Mlily, is the official pillow and mattress partner of the English soccer club Manchester United. His goal is for Mlily to become a global brand.

Growing up in a small town in Jiangsu Province, Mr. Ni came of age during China’s once-unimaginable economic transformation. Private enterprise wasn’t even legal when he was born in 1975. And once the state did open the door for private entrepreneurs, they faced persistent obstacles — as they still do even today.

“Of course, there are a lot of things that are unfair,” Mr. Ni said. “The state-owned companies have an advantage. Those who have the right connections have an advantage. But in this environment of development and expansion, anyone can find their own way.”

Today, Mr. Ni estimates his personal wealth at $400 million. Many Chinese executives cozy up to local governments to gain advantages, but Mr. Ni says he keeps a distance from officials, hewing to a philosophy that “it’s better for business to stay business.”

In the long view of Chinese history, it is remarkable how the country now embraces entrepreneurs, given the traditional Confucian condescension toward profit-seeking merchants. To catch up to the West, the party embraced market mechanisms and capitalist ideas not as end in itself but as a means through which to achieve national wealth and power.

Party leaders have always worried that private business could evolve into an independent economic force, and some in the West predicted that capitalism could be a Trojan horse for democratization. Yet though Mr. Ni resists joining the party, he is fiercely patriotic, loves China and believes that, ultimately, party leaders want what is best for the country.

“This country is my land,” he said. “And as long as I live on this land, I will be comfortable and have self-respect. That is what’s important to me.”

Private enterprise wasn’t even legal when James Ni was born in 1975. Now he owns this mattress company. Gilles Sabrié for The New York Times Mr. Ni, center right, said local officials didn’t interfere with his business because he complied with regulations, employs about 3,000 people and is a major tax contributor. Gilles Sabrié for The New York Times

Party leaders legalized certain private enterprises in 1979 and made a historic shift in 2001 by accepting capitalists as members of the party itself.

“Allowing private entrepreneurs into the party really reinforced a certain mutual dependence between the party-state and the private economy,” said Kellee Tsai, the dean of humanities and social sciences at Hong Kong University of Science and Technology.

Even so, the rules of competition have been tilted in favor of state-owned enterprises. Mr. Ni’s first business venture, selling software, failed. He got into the bedding business after noticing the high prices of memory foam pillows in a shop display. But while state-backed companies could easily get bank loans, Mr. Ni, a private entrepreneur with no credit history, was shut out.

Instead, Mr. Ni raised 500,000 renminbi — about $60,000 at the time — in seed money in 2003 from friends and family, with over half coming from a single cousin. These trust networks are at the heart of China’s huge “gray” economy, operating outside the formal banking structure and providing an investment engine for a private sector.

As Mr. Ni’s company grew in Nantong, a city in Jiangsu Province, local cadres began to take notice. But Mr. Ni said they did not interfere because he complies with regulations, employs about 3,000 people and is a major tax contributor. That, in turn, helps the officials advance their careers by meeting production targets.

And even when the party does hand down orders, there is sometimes room to push back. Four years ago, Mr. Ni’s vice chairman told him that the government wanted the company to create a party cell inside Mlily.

“I said no,” he recalled. “It is just some middle-level officials trying to please higher-ups. It wasn’t an order that came down from Xi Jinping.”

But there are signs that under Mr. Xi, the space for maneuver may be shrinking. In recent months, leftist scholars, bloggers and government officials have publicly endorsed what appears to be a state-led shift away from free-market policies. Mr. Xi has recently sought to reassure private business leaders, praising their contribution to China’s economic miracle, but his broader approach has favored the state-owned sector.

“Today you have the largest bureaucracy in history, with a capacity to intrude in anything,” said William C. Kirby, a professor of China studies at Harvard. “It isn’t just ideology. There are now enormous numbers of interest groups that don’t like competition.”

For guidance, Mr. Ni often looks to Jack Ma, the executive chairman of Alibaba, who is China’s richest man and a cultlike figure among many businessmen. Mr. Ni is currently enrolled in a business school program that Mr. Ma established to cultivate China’s next generation of entrepreneurs.

Over the years, Mr. Ma has spoken publicly about the push-pull relationship between private companies and the government, though there is one piece of his advice for entrepreneurs that Mr. Ni seems to have especially taken to heart: “Fall in love. But don’t marry.”

The Pull of Home

Over time, Hua Yijia felt the pull of China. The feeling surprised her.

Living in Boston, Ms. Hua had received an elite education in the United States, landed a consulting job and even contemplated applying for American citizenship. She loved jazz and American pop culture.

But more than a decade after she left China, she decided to return in 2007.

Part of it was opportunity: a job prospect at a consulting firm in Beijing. Part of it was a tinge of disillusionment: She had seen Chinese friends hit a “bamboo ceiling” in corporate America, even as the careers of friends in China seemed to be taking off. And part of it was something deeper: a desire to help the country catch up with the West and to reconnect with her Chinese roots.

Now a partner at a venture capital firm, Ms. Hua, 44, has a daughter whose elementary school offers a steady dose of Tang dynasty poems, calligraphy lessons and excursions to ancient sites. “She needs to know where she came from,” Ms. Hua said.

Exposed to liberal democracy, Ms. Hua’s generation was supposed to be the one that demanded it at home. Middle-class Chinese students poured into universities in the United States and Europe — then seen as the most promising path to wealth and prestige — and some Western analysts predicted that they would return to China as a force for political change.

Like many other middle-class parents, Ms. Hua worries about repression and rampant materialism in Chinese society. Yet many of these parents say they want their children to see themselves as Chinese above all else — to understand China’s roots as an agrarian society and to have a sense of pride in the perseverance of the Chinese people through decades of poverty and strife.

Communist Party propaganda on a giant electronic billboard: “The people have faith. The nation has hope. The state has strength.” Gilles Sabrié for The New York Times Hua Yijia, second from right, studied in the United States, but moved back home in part to reconnect with her Chinese roots. Giulia Marchi for The New York Times

Patriotism has run through centuries of Chinese history, uniting the country in difficult times and, more recently, blending a pride in the cultural legacy of China’s civilization with deep resentment over the humiliations at the hands of foreign powers during the colonial era. It is a volatile mix that the party skillfully manipulates to stir the feeling that China needs to stand up in the world.

Even as some analysts argue that China’s success has more to do with the resilience of its people than the Communist Party and its policies, leaders have been adept at shaping a politicized nationalism that reinforces the primacy of the party — and defends the authoritarian model as the best bulwark against chaos.

“Chinese nationalism binds the people with the state, not to each other,” said Minxin Pei, a professor of government at Claremont McKenna College.

Mr. Xi has selectively revived traditional Chinese culture — an effort, experts say, to give people something to be proud of. That approach, however, is rich with historical irony. Both the modernizers who overthrew the Qing dynasty and then Mao and his communists once blamed Chinese tradition for holding the country back.

But with communist ideology long ago having lost its appeal to the public, Mr. Xi is drawing on Chinese tradition to reinforce the idea that the country needs a strong leader to prevent chaos and to guard against outsiders. That leaves some worrying that he could be leading the country into a new period of isolation.

“Opening up and learning from the West is not a humiliating thing,” said Zhu Dake, a scholar and cultural critic in Shanghai. “Chinese culture is not a self-enclosed culture, and our greatness is not wholly self-created. Unfortunately this is a minority point of view.”

Ms. Hua’s apartment complex overlooking Chaoyang Park in central Beijing is covered with propaganda posters, including displays celebrating “socialist” values like “patriotism” and “honesty.” She said she worried that it had become nearly impossible to criticize the country without being labeled unpatriotic, and she is uneasy with tightening censorship and information control.

“I’m a Chinese citizen,” she said. “It doesn’t mean I think everything in China is great.”

But if she has grievances, she still believes society is moving in the right direction — and has made peace with waiting. “Two steps forward, one step backward,” she said.

Ms. Hua has started to take her daughter on trips to poor parts of China, to show her the vast inequalities that still persist, even in an age of mobile payments and self-driving cars. She hopes her daughter will live in a more tolerant China, one still open to the outside world.

But that is not the same as wanting China to be just like the West.

“I hope my daughter will have the chance to be exposed to different worlds and different cultures,” she said. “But she was born in China. She grew up here. She will always need some understanding of who she is and what it means to be Chinese, from the very beginning.”