Apple (NASDAQ:AAPL) has made a massive bet on China. 

The company uses two Chinese manufacturers, Foxconn and Pegatron, to manufacture its phones and tablets. It's also heavily dependent on components that are sourced from companies in China. 

Though Apple is notoriously tight-lipped about its supply chain, CompareCamp did an extensive study of its manufacturing and found that the company had 349 suppliers in China as of September 2014. That is by far the largest number of suppliers for Apple's products to come from any one country. It is all the more staggering when one considers that Japan has the second largest number of suppliers 139 followed by the United States at 60.

While Apple has nearly perfected its process of designing products in the U.S. and making them in China, the company is vulnerable to any potential changes in the country's political landscape or its relationship with the U.S. government.

The iPhone 6 is manufactured in China. Source: Apple

A shifting field
While Apple has maintained a long-term relationship with its Chinese factory partners, as well as its vendors, the entire country has a shifting attitude toward foreign companies.

"China's manufacturing market is becoming an increasingly rocky -- not level -- playing field," Laurence Brahm, an American who has served as an adviser to the Chinese government since the 1990s, told the Fool. "Foreign companies are increasingly subject to higher thresholds of standards from tax and labor authorities."

Brahm, author of Fusion Economics: How Pragmatism Is Changing the World, has written over 20 books on Asia and he helped negotiate entry into China for a many multinational corporations including Kodak, ExxonMobil, and Ericsson. He believes that Apple is manufacturing in China not simply to save money, but to have access to country's growing middle class.

"Apple is betting on the massive Chinese market -- both youth and rising middle class -- who view the Apple brand as a symbol of status, wealth, and success," he said, but that comes with risks. "Alongside the status that a foreign brand brings, there is a paradox in China as Chinese crave to challenge foreign products. An almost anti-foreignism is arising in some segments of society and the national psychology now demands local brands that can compete -- and win -- against foreign products. This is a future challenge Apple will face."

It may be beyond Apple's control
Brahm said that China is very clever in managing its foreign relations, especially in relation to investments.

"If there are political problems with America, they purchase Airbus jets from France. If they feel the French are not cooperating, they buy Boeing from America," he said.

China's diplomacy, he explained, is not about ideology but economics. He believes Apple's risk is not so much from U.S./China relations breaking down, but from how the two economies differ.

"With a totally leveraged economy from top down which is not engaged in basic core manufacturing and export industries, the fixated reliance on the global supremacy of America's virtual economy is only a short term illusion," he said. "...So Apple's executive board might want to think about manufacturing at home and exporting abroad to hedge risk. America should have at least one real industry in place before the next financial crisis which is just incubating." 

Moving is not so simple
Apple has heavily invested in China and CompareCamp estimates it would cost the company $600 million if it had to bring its operations back to the U.S. Interestingly, the site also reported that an American-made iPhone would only cost $4 more to make, but the company would pay 35% in taxes on profits on the phone versus the 2% it pays now. 

"The extra costs would be something like $4.2 billion. And even at Apple that's a fair old chunk of money," wrote Forbes contributor Tim Worstall whose extensive breakdown was cited by CompareCamp.

Of course, China is not the only abroad market which has manufacturing advantages, but Brahm thinks the company should be wary of its long-term ability to operate in the country. He said that foreign firms are increasingly finding that the law in China is applied unevenly between domestic and foreign invested companies.

"More often domestic competitors are given shadow favored treatment making it difficult for foreign companies to compete," Brahm said. "Apple must be prepared to face such complications in the future, especially if its success in the China market continues. Domestic competitor jealousy and how it could influence local regulators is a risk factor that Apple cannot ignore in its long term China market strategy planning."

An opportunity too
While having many of its eggs in the China basket presents a risk for Apple if the country becomes less accommodating to foreign business, the company has its fans among the nation's growing middle class. 

"The Apple brand still carries magnetic magic in the eyes of China's aspiring middle class who want to buy status with their newfound wealth," Brahm said. "To carry the latest Apple iPhone is a symbol of success and the demand for these has become a litmus of one's social status."

This has made Apple products popular despite there being cheaper alternatives from companies including Samsung and Xiaomi. 

"The Apple brand is China's tech status symbol in the way that a Prada or LV accessory may be [in the U.S.]," Brahm said. "With this in mind the growing middle class in China still presents Apple with its fastest growing market."

One more risk for Apple
In addition to Apple having to worry about relations between the U.S. and China, Brahm feels the company should also be concerned that the country will ultimately become a competitor.

"We often think that China will not compete with America on high tech innovation. But this assumption is wrong," he said.

The logic, Brahm explained, is that the Chinese education system produces engineers who are too dominated by political red lines to allow creative innovation. Because the country has a one party system, he does not expect it to  liberalize its education mode. But this, he said, does not stop China from becoming a technology innovation giant.

"They will buy the best and the brightest from all of America's top schools and they have the money to do this," he said. "Stanford is already packed with Chinese students. After they graduate and work for Google and Facebook for a few years, China will double their salaries and hire them back."