That would be “CEC” and if resetting the bus like Grahamh suggested doesn’t cure your issue, then the relevant settings would be found in settings>system>input>peripherals>CEC Adapter. Notable settings would include “switch source to this device on startup” (despite the name this controls more than just startup) and “connected to device” if your using a CEC enabled AVR/soundbar. Also note that there may very well be CEC controls in a display and other CEC devices connected to said display that may also enable unwanted switching behavior. These vary a lot and often come down to just playing with different settings until you produce the desired behavior.
EDIT: After typing the above I re-read the OP and perhaps this isn’t a CEC thing but rather the intended refresh rate switching. Basically the devices switches display modes to most closely match the source material. When this happens you will generally see a brief black screen and then your TV’s OSD may appear denoting a change in the display mode. This is normal and expected. If you want to minimize this you can change your UI refresh rate in settings>system>display to what you play most often. This would be 50hz for UK content for example, or in the US 59.97 for broadcast TV and 23.976 for most movies.