There is a page on official documentation (docs.joinpeertube.org) (which needs to be updated to reflect the removal of WebTorrent but is still relevant on hls parts).
Here is the one concerning us:
" - If using the HLS player (depending on the admin transcoding configuration):
- The player loads the HLS playlist using hls.js from the origin server
- PeerTube provides a custom loader to hls.js that downloads segments from HTTP but also from P2P via WebRTC
- Segments are loaded by HTTP from the origin server + servers that mirrored the video and by WebRTC from other web browsers that are watching the video. They are used by hls.js to stream them into the <video> HTML element"