Relationships are everything -- even at the upper echelons of global trade.

As trade tensions roiled the markets this week, there's been some hand-wringing that Apple (AAPL) could get caught in the crossfire.

Apple's dealings with China are extensive, both in manufacturing and in sales of its flagship products. Of Apple's $247.5 billion in revenue over the last twelve months, 18% originated in mainland China according to FactSet, making it the second-largest market for Apple's products. 

The country also serves Apple's primary manufacturing base: "Substantially all of the Company's hardware products are currently manufactured by outsourcing partners that are located primarily in Asia, with some Mac computers manufactured in the U.S. and Ireland," Apple said in its 2017 annual report. A lion's share of the world's iPhones are assembled at a single Foxconn plant in Zhengzhou in central China, with the words 'Designed in California, assembled in China' inscribed on the back of each device.

Apple's extensive China ties sparked initial worries among investors, with shares slipping in mid-June as the White House talked up tariffs and potential investment restrictions on China. But so far, investors don't seem too spooked by the tit-for-tat, which escalated Tuesday with a new round of tariff threats by President Trump in addition to the $34 billion tariffs that went into effect on July 6.

Apple's stock price over the last month 

In June, the New York Times reported that President Trump had offered to exempt iPhones from tariffs in a meeting with Apple CEO Tim Cook, citing an anonymous source familiar with the talks. White House trade advisor Peter Navarro later denied knowledge of the conversation, but either way, Cook might not need the help. Apple is so embedded in China's economy that the relationships can likely withstand any belligerence emanating from the White House, according to Paul Denlinger, a strategist specializing in the Chinese technology market.

"Currently, there is no threat to Apple," Denlinger said.

A good share of the credit goes to Cook, who has spent much of his seven-year tenure pounding the pavement in China, visiting the country several times per year to speak at events, visit businesses and meet personally with government officials. 

"[Cook] goes to China between four to six times per year, and when he does he usually meets with the Chinese Premier Li Keqiang," added Denlinger. "Their manufacturing is done through Foxconn, which employs about one million people in China. Creating one million jobs in China is definitely seen as a position of strength, and the Chinese government certainly at this stage doesn't want to let anti-U.S. sentiment come to the fore."

For some, there's also skepticism that tariff threats are much more than political bluster.

"If I felt like the tariffs were sustainable, I think it could be a risk. But I think it's political posturing going on and there won't be tariffs," added longtime Apple analyst and Loup Ventures partner Gene Munster. "Say I'm wrong. It could have an overall impacton Apple's growth rate -- we think, maybe a two percent swing. It's a negative, but it's a very manageable risk."

Meanwhile, Apple has subtly touted its investments in the Chinese economy. In a March 2017 Chinese language press release, Apple said that it had "created and supported 4.8 million jobs in China, including 1.8 million iOS app developers and other iOS ecosystem-related jobs" there, in addition to more than 12,000 direct employees in the country. 

In addition to a pattern of monetary investments in China -- which have included a $500 million commitment to building R&D centers in China, and a $1 billion investment in ride-hailing leader Didi Chuxing in 2016 -- Apple has also shown a greater willingness to please Chinese regulators than other companies such as Alphabet  (GOOGL) , and a high level of sensitivity to public opinion there. In 2013, Cook issued a personal apology to Chinese customers for sub-par customer service in the country. 

On a May earnings call, Cook again reserved praise for China and enunciated the closely entwined interests of China and the U.S. 

"China and the U.S. have this unavoidable mutuality, where China only wins if the U.S. wins and the U.S. only wins if China wins, and the world only wins if China and the U.S. win," Cook said on the call. "I think history shows us that countries that embrace openness and diversity do much, much better than the ones that are closed."

Cook's careful cultivation of Apple's relationship with China may already be paying substantial dividends.  

Apple and Alphabet are holdings in Jim Cramer's Action Alerts PLUS member club. Want to be alerted before Jim Cramer buys or sells AAPL? Learn more now.

More from How-to

How Much Do Doctors Make in 2018?

How Much Do Doctors Make in 2018?

What Is Bitcoin And How Does It Work?

What Is Bitcoin And How Does It Work?

How to Trade Forex - and Is It Worth the Risk?

How to Trade Forex - and Is It Worth the Risk?

Kemet Has Had a Good Week, but Its Charts Are Far From Bullish

Kemet Has Had a Good Week, but Its Charts Are Far From Bullish

Housing Stocks May Have Put in a Floor

Housing Stocks May Have Put in a Floor