How does Syncthing connect two devices?
Each device has a device ID created on first start. You add the other device's ID on both sides, and they connect once each is configured with the other's ID. Syncthing tries a direct connection first and uses a public relay when that is not possible.