YouTube automatically generate videos in lower resolution of the one uploaded.
So when you watch a 4k video and switch to 1080, you are no longer watching the original video but a re-encoded one by YouTube itself which could have more artifacts since it’s resized and compressed.
I dunno the exact specs (like bit rate, etc.), someone will probably add them in another reply.
You are right. For example you can upload an avi to YouTube, but they will never host and stream an avi.