Short answer:
It is done for performance.
Reasoning:
Browsers have a limit on the number of connections it can make to a single domain. This is especially important when you are dealing with IE6 who only has
2 connections to a domain. If you ever tried to communication with iframes/frames/popup windows/Ajax with a sub domain you know the browser gives an error because it sees it as a different domain. So by using different sub domains/
cnames you get around the two connection restriction and get more connections!
For a real world example, look at
google maps. They pull their images from multiple cnames. I think it is something like
mt#.google.com where they grab the tiled images as you move the map around.
Do not run out and get all cname happy.
You should not make each file have its own subdomain. There is a limit on the number of CNames that you should use on a single page. Performance drops or levels off at four or five depending on the browser and connection type. If you search the net, you can see people sat down and tested the performance with browsers and the number of CNames. It basically came down to the number of open connections allowed by the browser and the size of the tube [bandwidth]. You hit a point when too much of a good thing is bad. Tell that to a kid on Halloween as they eat 50 candy bars, their stomachs will not like them in the morning.
My personal real-life experience:
I actually landed a job by suggesting doing the cnames for static content, it chopped off 24 seconds off the load time in ie6 and about 16 seconds in firefox 1.5. Page in IE6 took over a minute and a half to load before I started my magic, got it down to under 20, wanted to reduce it more, but they did not want to make the drastic changes required. So I am that crazy consultant that came in and improves a site's performance! It is amazing what simple little changes [compression, caching, cnames, location of resources] can do to page load times.
It really makes sense after you see it work first hand. It is not all smoke and mirrors!
Eric