Apple Inc. (AAPL) is doubling down on its largest overseas market. According to reports, the Cupertino, California-based company is building two new research centers in China at a total cost of $500 million. The two centers will open later this year and be situated in Shanghai and Suzhou. They bring the total number of Apple research centers in China to four, as the company had announced centers in Beijing and Shenzhen last year. The latest announcement comes on the eve of CEO Tim Cook's trip to China, where he is scheduled to meet with top government officials.

There are multiple reasons for Apple to build research centers in China. For one, it could help the company understand the local market better and employ strategies tailored for it. For example, China uses a different WiFi standard than the United States. As a result, Apple was forced to release its iPhone without Wireless LAN access when it was first launched in China. (See also: Apple's Chinese Revenue Problems.)

The investment could also boost Apple's image with the Chinese government. According to Bloomberg, foreign companies generally build research centers in China to "signal long term commitment and curry favor with the government." Apple's sales in the Greater China declined by 11% during its latest quarter even as it reported record revenue overall. That slowdown reflects a decline in the company's market share as local competitors have surged ahead at Apple's expense. For example, Oppo and Huawei manufacture phones with features similar to those of Apple's phone but sell them at a fraction of the price. (See also: Apple Loses Grip on Chinese Market.)

As sales of the iPhone have declined, Apple is ramping up its investment in untapped foreign markets. The company is also in talks with the Indian government to set up manufacturing and assembly operations in the country as a precursor to a full-scale launch of its smartphone. (See also: Apple iPhone SE to Be First Model Assembled in India.)

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.