It doesn't, that's a different feature called LAN play.
LAN play mostly exists to be able to reliably connect Switches to each other at tournaments and such (which is why you find it more frequently in competitive games). It doesn't connect to Nintendo's servers, it just looks for other devices on the same network for local play purposes. Its not the same thing as regular local multiplayer, that's a different feature.
You can somewhat trivially intercept this using DNS if you want to do long-distance co-op, but it's absurdly jank from my experience.
Also both Ryujinx and Yuzu support connecting with LDN_mitm which well, man-in-the-middles the LDN sysmodule on hacked Switch devices to enable the same thing as LAN play interception but then for titles that don't support LAN play.
LAN play mostly exists to be able to reliably connect Switches to each other at tournaments and such (which is why you find it more frequently in competitive games). It doesn't connect to Nintendo's servers, it just looks for other devices on the same network for local play purposes. Its not the same thing as regular local multiplayer, that's a different feature.
You can somewhat trivially intercept this using DNS if you want to do long-distance co-op, but it's absurdly jank from my experience.
Also both Ryujinx and Yuzu support connecting with LDN_mitm which well, man-in-the-middles the LDN sysmodule on hacked Switch devices to enable the same thing as LAN play interception but then for titles that don't support LAN play.