So the device that outputs to the TV (thin client is an oldish IT term for like a dumb terminal, imagine a very basic PC that instead of booting to a native OS instead launched a VM or, more typically, a browser. They call it a thin client because its the thin layer that interfaces with the hardware) in the example i tested the laptop or nuc is the thin client, it has low native power but it does have an OS. So the Bluetooth or wireless controller can communicate with the hardware at the point of use. Moonlight, in this case, translates those inputs across the stream to the machine doing the heavy lifting.
TLDR is, you only need to be close to the machine plugged into the TV not the machine with the GPU. This is the issue with using a very long fiber HDMI cable. Although the video can be run a decent distance the input needs a way to get back to the host