After each step, see if you can connect to the appleTV.
- Verify that the iPad and the AppleTV are on the same SSID on the wireless network (settings -> general -> network)
- Verify that airplay is turned on on the appleTV (settings -> airplay)
- Verify that airplay is turned on on the iPad (settings -> airplay)
- Restart the iPad
- Restart the appleTV (menu)
- Update the appleTV if updates are available (menu)
- This may take a while
- Reset the appleTV to factory defaults [ONLY IF YOU DO THE FOLLWING]
- Write down the current name of the appleTV so you can restore it
- Someone knows the password to the wireless SSID of the iPad
- Once you verify that, do these steps:
- Restore factory defaults (menu)
- Connect to the same wifi as iPad
- Turn on airplay
- Rename the appleTV to the old name
Also see this article: https://support.apple.com/en-us/HT204291