It didn't always work right. The result was invalid HTML that could cause other problems. If the browser was older, nothing of the music was seen anywhere on the page. This requires that JavaScript sniff out the browser in two places. Sniff for MSIE and if true, write bgsound HTML, else do nothing.
Lets look at what is happening here as the page loads.
A property of all browsers in how they interpret HTML is that when they see a HTML element they do not understand, they ignore it. They MUST appear in your HTML exactly as shown. If the line wraps, the programming will NOT work and you WILL get errors about the JavaScript. The documentation about HTML supported by the IE 3.0x browser has been deleted, so one has to kind of figure it out by trial and error. The documentation includes version numbers of each HTML element supported.