If iPhones/iPads don't support Flash, how do they play YouTube?
They use a format called H.264. YouTube and other video sites deliver content in this format also (so that their videos are viewable on iPad/iPod touch).
One advantage of H.264 is that hardware based encoding/decoding can be used.
See also Steve Jobs's Thoughts on Flash
H.264 is one of the formats for video support in the latest version of HTML, HTML 5. Apple supports this in Safari and Google in Chrome*.
*Google recently announced that it will no longer support H.264 in the future versions of Chrome.
Because of this H.264 is kind of hot of late. See these articles.
Nivas said all there's to know about H.264, the format used by YouTube to stream video. But that's how the video is encoded and decoded and it's used by flash, iOS (iPhone operating system) and HTML5.
The real difference is how the request for the video is done. In a nutshell, iPhone requests it the same way HTML5 and Flash do but grab the answer from youtube and plays it elsewhere instead of the browser or flash.
On a desktop, when you get to youtube.com it identifies you're on a desktop browser, because the browser informs YouTube about it. Then YouTube points you to the Flash version and all its code is already programmed to play the video in its own way. That also envolves HTML and H.264. So picture the path a byte of the video do from YouTube files to your screen. It'd be something like this:
YouTube streaming server -> your browser -> Flash -> screen.
When you point your browser to the HTML5 version of YouTube, the code in there just expects your browser will be able to play it using no Flash. So the video byte path would be:
YouTube streaming server -> your browser -> screen
It's funny how simple it is to think about it now, but HTML4 never had any code to communicate "play video" on its own, and no browser were expected to be able to do so. So HTML5-enabled browsers actually are video players on their own as well.
Both that new browser and Flash have basically the same source code to be able to decode H.264 and both need the codec to be available from the operating system. But each one have their own implementation of it.
On iOS, whenever it identifies "YouTube" while you're browsing, it looks for either code, HTML5 or Flash embedded, grabs the video reference from that code and just ask YouTube for the video directly. Much the very same way HTML5 does. But instead to play it within the browser, it calls an iOS API to play it from the video player. So the video byte path is:
YouTube streaming server -> iOS video player -> screen
Of course, there's a whole lot more beyond that, but those are the basic concepts. So the technology iPhone uses is all the same and practically transparent to YouTube servers.
YouTube also has HTML5 players - they recently changed their embed code to an iframed method which allows HTML5 and Flash to be shown depending on your browser setup, which the iPhone supports.
Essentially, the Flash player is a way of playing a video file, so the file is available in a readable format (as Nivas was saying) that the iPhone/iPad can open in its media player.
Soundcloud also works on the iPhone, which I think is down to HTML5.
When you upload a video on Youtube, it is converted into multiples formats, sizes and codec (not only FLV/VP6 flash video!).
Doing this, Youtube can serve you the best compatible option when you request a video depending the application / web browser (mobile or not) / bandwidth you have.