For years, most Mac computers have included a little remote to control media playback in iTunes. When Apple released the Apple TV with the little silver remote, they decided to use the same infrared commands on the new device. Now, any time you use buttons on your Apple TV remote there is a good chance you are inadvertently controlling your Macs as well.
You can, however, tell your Mac to only respond to a specific remote or to disable remote control entirely.
Apple menu > System Preferences > Security & Privacy > unlock the padlock button if needed > Advanced button. From there you can either tell your Mac to not respond to any remotes with the checkbox or you can click the “Pair” button to make your Mac only work with one specific remote. If you don’t see these options there it probably means your Mac doesn’t have the infrared receiver and shouldn’t be affected by this problem.