From an HTML Document Object Model point of view, frames are rather odd creatures because they are essentially HTML documents within HTML documents. Consider for a moment the fact that it is possible to have more than one document at a time. For example, the following is perfectly legal:
document.frames[1].document.body