There should be a setting in your TV to change this from happening. Check under CEC settings or something similar. They are labeled CEC settings on my TV.
Yes, what JackieInCo said. There are options for devices to control each other via HDMI. I had issues with my Pioneer receiver which was turning off when I put the ATV4 to sleep. It's probably called "SimpLink" in your TV menu settings.