Flush with cash in overseas accounts, Apple announced Thursday that it had invested $1 billion in China’s most dominant ride-hailing company, giving the consumer electronics giant a stronger connection to a country that is critical to its future success.

The beneficiary of Apple’s decision — a Beijing company called Didi Chuxing — is a major rival of Uber in China. Although the deal ranks as one of Apple’s biggest investments, the stake is basically pocket change to the tech giant. As of its last quarterly earnings, Apple had a staggering $233 billion in cash and securities, mostly parked overseas. Bringing that money back to the United States would come with a costly tax bill.

Apple instead appears to have focused on using its wealth to invest in China, its second-largest market after the United States.

“Real question I have is why aren’t they doing more of this?” said Colin Gillis, a technology analyst at BGC Financial. “They should be putting that cash to work.”

The deal comes as Apple's business has lagged in China as demand for smartphones has slowed. The company’s sales in China, Taiwan and Hong Kong were down 26 percent during the first quarter of 2016 vs. the same period the previous year.

Apple has historically had a better relationship with the Chinese government than other American tech firms but has faced hurdles in recent months. In April, Apple’s online iBooks and iTunes Movies stores were shut down in China — six months after they launched there — because of issues with regulators.

The investment in Didi Chuxing could help ease tensions going forward, according to some industry observers.

“China is an interesting country to work in — and to get more things done, it usually takes major local investments by foreign companies,” said analyst Patrick Moorhead of Moor Insights & Strategy. “This sends a message to the Chinese government that Apple is willing to commit.”

Apple did not immediately respond to a request for comment. But in an interview with Reuters, chief executive Tim Cook said, “We are making the investment for a number of strategic reasons, including a chance to learn more about certain segments of the China market.”

China's ride-hailing industry may also be attractive because the country is in a race to define the future of transportation. It is investing in companies that can build electric and driverless cars. And China is giving those businesses the regulatory clearance to put such vehicles on the road.

But not all companies will be treated equally as China continues to develop. Its government has a clear preference to helping its own native industries.

Notably, Uber chief executive Travis Kalanick told Canadian tech site BetaKit in February that his company is "losing over $1 billion a year in China" as part of a struggle to compete inside the country.

Didi Chuxing says that more than 11 million rides are completed on its platform per day and it serves 300 million users in more than 400 Chinese cities. The four-year-old company’s other investors include some of China’s largest Internet companies, but Apple’s investment is the single-largest it has ever received.