iPhones (and many electronics) are made in a factory that is situated within a special economic zone in China. This zone is kind of like the international terminal of an airport. You have left the country but not physically out.
The reason for this is there are certain taxes a domestic company will have to pay but when you’re in this special zone, you don’t have to. You can export items that haven’t been taxed. The kicker is when you’re selling these products back to China, you are essentially importing and therefore taxes and duties of China.
Hence this ban can exist.
Ah, of course, that makes sense.