I have observed that the size of mp4 videos are larger than webm for a same resolution video. Which makes me wonder that either there is some quality loss or compression in webm.
Youtube's MP4 videos are encoded using the H.264/AVC codec.
Youtube's WEBM videos are usually encoded using the VP9 codec which is a much more efficient and newer codec which allows to compress video better (which means a smaller file size) while providing a perceptually better image quality.
Can we force download 4k videos as mp4 instead of webm?
Why force to download something which has a worse image quality and larger size? Also, YouTube has long stopped encoding >=4K videos into AVC/H.264 and they are now provided using VP9/AV1 codecs exclusively:
Here's an example (a video uploaded last week):
youtube-dl --list-formats https://www.youtube.com/watch?v=Cc5mchDdNdg | grep 2160
313 webm 3840x2160 2160p 17842k , vp9, 30fps, video only, 585.18MiB
315 webm 3840x2160 2160p60 26526k , vp9, 60fps, video only, 969.16MiB
No sight of AVC or MP4 - WEBM/VP9 only.