When watching a video on YouTube, if it data stream is not fast enough (i.e. slower than real time) then you will catch up with how much your computer has received and have to wait for it to receive more before you can continue. This could be due to a slow connection at your end or an overload at YouTube's end.
eg. Imagine someone writing a passage on a blackboard and you are reading it. If you read it faster than they write and you catch up with them then you have to wait until they have wrote more before you can continue reading the rest. The same principle applies.
As for music, I'm not sure how you download it but it will most likely be for the same reason.