It seems like YouTube show closed captions even when the tab isn't in focus. For instance, on https://www.youtube.com/watch?v=rStL7niR7gs this closed caption window is outside of the window playing the video:
There's a <track> element according to https://web.dev/media-accessibility/, but an example on https://track-demonstration.glitch.me/ using the <track> element which is styled differently, and does not achieve the same effect. Additionally, the <video> element on YouTube does not appear to have a <track> element.
What browser feature is powering this, and how would I add it to a video?