I have a smart TV with YouTube app. I seen that the existence of the smart TV is detected by my phone’s YouTube application as well as Chrome/Chromium browsers on phone as well as on desktop. This allows me to cast video on TV directly.
FireFox does not seem able to detect smart TV or at least not showing me the cast button while visiting YouTube.
General theory is there must be something in air (or at least on the network) that TV is broadcasting and Google products are detecting it.