This is an Accessibility feature that you can toggle ON or OFF in
Settings » Accessibility » Guided Access
https://support.apple.com/en-gb/111795
Once toggled on you can open your app and press (for iPads) the top button three times to bring up the settings (and password protect it). Once done pressing the top button three times again brings up the panel to switch it off for that session. I think you can also set a timer but I didn't play with that feature.
I used it to trace (soft pencil!) round something on my iPad that otherwise was otherwise skittering about the page and refusing to sit still. The Apple help forum posts were from parents of toddlers wanting to find a way to stop their child from repeatedly closing YouTube and in one case to stop their cat from doing that. So those are probably the main use cases ;)
It will let you restrict the screen to display one active app and you can also tinker with it to switch off the touch screen, so handling the screen doesn't stop the video. But also useful for ad hoc art projects where tracing something is wanted. I'd hoped that the tracing paper might block with the touchscreen functionality but it did not. At all.
Jo