It's true that it does need some kind of Wi-Fi network, but it does not need an internet connection or an external connection, like a Wi-Fi router.
How it works is that one device makes its own little Wi-Fi network that only the other device is able to join. There's several technologies behind this like Bluetooth, Wi-Fi Direct, and Apple's Bonjour service.
Rather than rely on an already established Wi-Fi network, the devices establish a one-to-one connection. Think of it like a text message conversation (peer-to-peer) compared to trying to talk to someone in a crowded chatroom (network sharing). Not only do you not have to have a premade Wi-Fi network (the two devices make one with each other, kinda like one device makes a phone call to the other), it actually gives better performance too.[COLOR]