To use picture-in-picture (PiP), exit the YouTube app while a video is playing. If you have the PiP setting turned on, the video will shrink into a PiP window. The PiP window can be dragged to different parts of the screen, allowing playback to continue on top of other apps.
With Picture in Picture, you can watch a video or use FaceTime while you use other apps. or press the Home button (on an iPad with a Home button). The video window scales down to a corner of your screen so you can see the Home Screen and open other apps.
Background play only works in the YouTube mobile apps and requires a YouTube Premium membership. Some videos aren't available for background play or to download offline, even if you have a channel membership.
YouTube Default Settings
The principal reason your YouTube video may pause is that the Auto-Pause feature is set by default. This feature is designed to pause the videos if you've been inactive on the device for a while and prevent you from missing important details in the content you were watching.
YouTube ambient mode is available across across iOS, Desktop, and Android.
You need to make sure that no other app on your mobile device is playing a video. You can restart the YouTube app and then check whether you can successfully play YouTube videos in background. You can restart your mobile device to remove the temporary issues that may cause YouTube background playback not working.
Restart Your iPhone (iOS), iPad (iPadOS), or Android Phone
If YouTube still doesn't play your videos in picture-in-picture mode, your smartphone may have a minor glitch. You can reboot your device to fix many minor glitches in the system. Make sure to save your unsaved work before you turn off your device.