This is a little outdated, by Ryan Bigg does a great job explaining this here:
http://ryanbigg.com/2009/04/how-rails-works-2-mime-types-respond_to
In fact, it might be a bit more detail than you were looking for. As it turns out, there's a lot going on behind the scenes, including a need to understand how the MIME types get loaded.