China has been filing tons of patents because of the national prestige it brings. A large percentage are of dubious quality and they are setting themselves up for a huge patent troll problem 10 years from now, much like the US had as a result of bogus late 1990/early 2000s patents.
The US patent system has become much better (although Europe is still even better). They now reject over 90% of business method patents (i.e., doing business with a computer). Many of those would be granted in China.
The number of granted patents in any given country is not a good indicator of technical progress.
There are well established treaties for this. No country's patent office is forced to grant a patent filed in another country. For example, if you get a patent granted in the U.S., there's no guarantee it'll be granted in Britain. If you want a patent in both countries, you'll need to file a separate patent application in both countries.
The same goes for the U.S. and China. If a U.S. company only has U.S. patents, companies operating in China can make a product that directly infringes it. That said, the second that product is imported into the U.S., the U.S. patent will kick in, and you can get a judge to block it at the border.
Going back to the AI space, the fact that China has a ton of AI patents in their country won't stop Google from developing the same in the U.S. However, if Google tried to offer those infringing services to Chinese residents, they could be sued/stopped in China.
I think I understand how this works with a tangible good. But I have no idea how this works for more abstract goods, for instance like a machine learning patents.
Say I was given a u.s. patent on a an AI process that looks at photos of parking lots and tells you number, type, and length of stay of different cars. Now if someone steals my patent and sets up a server in country I don't like a patent like China. And then another company sends pictures of parking lots to the Chinese copycat company which runs my patented algorithm and then sends them back the data.
> Say I was given a u.s. patent on a an AI process .... Now if someone steals my patent and sets up a server in country I don't like a patent like China. And ... runs my patented algorithm and then sends them back the data.
>
> Is this illegal? Is there any way to stop it?
Yes, under U.S. patent law, this would still probably be illegal (but see below for some nuance). Given how globalized our economy has become, a very similar issue already came up over ten years ago. It wasn't between U.S. and China, but between U.S. and Canada.
Ten years ago, Blackberry reigned supreme in cell phones, and they were a Canadian company. They were sued by companies in U.S. courts holding U.S. patents over networking technology. Blackberry argued that most of the tech covered by the U.S. patents actually took place in Canada (where there were no corresponding patents). The U.S. judges said that, even though most of the steps were performed outside the U.S., U.S. patent law still applied. This is the short version of the story, you can read a much better write-up here: https://www.finnegan.com/en/insights/the-extraterritorial-re...
So, going back to your example of U.S. patented AI algorithms being run in China: If everything stays in China, then it won't be covered by U.S. patent law. However, even if just the results from that patented process that was done entirely in China get imported back into the U.S., there's a good chance that U.S. patent law would kick-in and whoever did that importing could be sued.
That said, this is a relatively new area of patent law. Patent law has been around for hundreds of years, but globalization has only been around for a few decades. The truth is that U.S. judges don't come across these issues very often, so even though it's likely illegal, maybe it isn't, it's very fact and case-by-case specific. It's likely the exact parameters of what is and isn't allowed will be fought in courts for many more years to come.
The US patent system has become much better (although Europe is still even better). They now reject over 90% of business method patents (i.e., doing business with a computer). Many of those would be granted in China.
The number of granted patents in any given country is not a good indicator of technical progress.