How does YouTube convert between different videos resolutions?
Youtube stores whatever you upload and transcodes to other formats using their own versions of multiple compression formats including h.264 and webm.  All transcodes go from the same original file that you upload and are stored after transcoding.  Youtube may change the options used from time to time and save new encodes of the video.  Encodes are generally pre-rendered upon upload and then used from disk as far as I can tell.