But doesn’t it have to be on the same WiFi network?
I think for it to actually work, yes, it does need to be on the same Wi-Fi network. However, I think you can still view other peoples Apple TV's for AirPlay, not sure why.
I live in an apartment and have 2 Apple TVs in my house, and this is what I get when I click on the AirPlay icon on my iMac:
The only two Apple TV's in that list that are mine are the ones labeled "Living Room" and "Bedroom".
I erroneously clicked on the one labeled Apple TV (5) once and nothing ever happened, that's why its under AirPlay To: along with the Apple TV I actually use AirPlay on, the one labeled "Living Room".
Hope this makes sense.. sorry if it seems confusing.