Two ways - it uses UDP instead of TCP, which is a lot easier to get to work through NAT on both sides of the connection. We should do that, at some point, but there is a significant amount of work required.
The other way is that they send your data through their relay servers. This is obviously never going to happen with syncthing, but you can emulate it by setting up a device that is reachable on the internet. Currently this requires also storing a copy of the data there. There are various issues filed on that already.