As mentioned above, the difference is context.
The first line will search for all elements of a given tag name occurring inside of the body tag.
The second line searches for all elements of a given tag name occurring inside of the entire document.
With context comes speed: if you can make your search as narrow as possible, you will find your elements faster and your application will perform better.
As your documents become more complicated, you will notice that something like this:
document.getElementById('foo').getElementsByTagName('span')
will start to perform noticeably faster than a plain old
document.getElementsByTagName('div')
Plus, in narrowing scope you will have less results, which means less iteration through DOM nodes looking for the ones upon which you wish to operate.