I am currently studying Internet of Things and found that there are bunch of devices are using zigbee and Wifi. Take Xiaomi smart wifi plug for example, it does not require an extra gateway(router) to connect to WAN. I assume it connects to my LAN via gateway first and the gateway takes it to the WAN. On contrarily, Xiaomi smart Zig-Bee plug requires Xiaomi-gateway to be connected to WAN. My question is why it can not connect to my LAN gateway as the Xiaomi smart wifi plug does. Aren't they all have soc chip on board like a normal pc does? My reference is from here
Second, many smart wifi plugs support cell phone that connects to different network other than the one wifi plugs to control the wifi plugs. For example, control your home devices when you're outside. I can not get how this works. I thought devices can only talk to devices that share the same network(LAN).
Thanks!