There are two types of password protection for AirPlay.
The first is an on-screen passcode, in which the Apple TV will display a four number password on screen, which you must enter into your mobile device before AirPlay can be enabled. This is typically to ensure that users are in the room where the TV is, before enabling AirPlay. This typically protects against intentionally disruptive behaviour from someone somewhere else while someone is trying to use AirPlay.
The second is a hidden password which needs to be remembered by all users who will have access to AirPlay, unless you share this password with others. This method doesn’t lend itself well to use by guests unless you tell them your password but it does mean that accidental attempts from others don’t disturb you.
You can turn either type of protection on or off by navigating to Settings > AirPlay.