This is a strange one. We were all sitting watching TV in the living room, when all of a sudden the Apple TV turned on and the AirPlay request screen was shown, asking us to enter the 4 digit code to allow ‘Chris’ iPhone XR’ to connect. Now, there is no Chris in our household, so there was mild panic that somehow someone was accessing our Wi-Fi network.
After some Google searches, I found the culprit. There is a setting on the Apple TV (that is enabled by default) that allows ‘nearby’ devices to connect in addition to local devices. Local devices are those on your network; however, the definition of nearby also includes those that can connect over Bluetooth and not just Wi-Fi. Therefore the offending ’Chris’ must have been pretty close of our living room (we live in an apartment, so this could easily happen), and accidentally selected our Apple TV in their AirPlay list. Our Apple TV is named ‘Family Room’, so perhaps my lack of originality did not help. If I had named it WOPR (from the fantastic 1983 film War Games), he may have had to think twice!
To turn off this setting on the Apple TV, navigate to the Settings -> AirPlay -> Allow Access and set it to Anyone on the Same Network. This will restrict access to those connected to your local network, therefore removing the ability to connect using Bluetooth.
For details of the other options, please refer to the official Apple Support page.