They only let some of them out. And it's hard to get a passport. Most other countries work the opposite way. You need approval to enter. In China, you need approval to exit.
One way to think about it: if every country prevents people from entering, the effect is exactly the same as one country preventing people from leaving.