Yes, YouTube and every other video streaming platform transcode and compress your uploaded video. It’s unavoidable, and it does result in quality loss in the final uploaded video. However, you need to make sure your video runs smoothly and the quality loss isn’t severe enough to hinder the viewer experience.
To ensure your video quality, try to upload a high-quality video so that even if the video is compressed, the video quality isn’t highly affected.