system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Music recognition software like Shazam. 

This sounds extremely stupid, but I was wondering how exactly music recognition software recognizes music. I have been able to tag music from the radio, in the mall, and even off of TV with people talking over it. I know it's not "magic" but I want to know how it's able to do that.
gpt
Remember how, when you were a kid, you'd try to hastily sketch someone's face? When you were young, the face probably looked pretty silly - the features wouldn't be proportionate, the eyes would probably be uneven - you'd barely be able to tell it was a face, right? Then, as you grew older, your ability to draw faces got better. With the same amount of time and using the same amount of lines, you could draw a better face than before, this time taking into account the unique features that separate people's faces and carrying them over to the paper.

Think of music recognition like that. Services like Shazam need to get that song recognized, but they can't just send a clip of the whole song and compare it; that would take incredible processing power and quite a while for the database to locate the correct song. Rather, music recognition focuses on a song's *acoustic fingerprint*, which is a property unique to every piece of music. Instead of trying to draw the whole 'face', the acoustic fingerprint picks up tell-tale features like the song's spectral flatness (how the audio deviates from pure noise), tempo (speed), zero crossings (where the sound waves go from positive to negative/vice versa), bandwidth (the difference between upper/lower frequencies), and so forth. Think of these as the easily recognizable facial features; two songs may sound very similar, but their acoustic properties will be very different. 

Now, once you've stripped away everything but those few recognizable details, you can easily search through a database. Each detail works to narrow down the search; for example, there are millions of songs, but only thousands of them have a tempo similar to, say, Led Zeppelin's Black Dog. And only a few dozen of them have similar zero crossovers. 

As for how the audio recognition is able to pick out music even through background noise; background noise is generally highly random and can't be analyzed as anything more than that, noise. Music, on the other hand, is rhythmic and easier to isolate. It's still possible to confuse audio recognition enough by making noise over the song it's trying to recognize, which is why services like Shazam generally listen for ten seconds or so to get multiple samples in case one of them has background noise.

EDIT: Also, the above reasons are why music recognition services can't pick up the sound from live performances; even if the song sounds exactly the same to the human ear, the acoustic characteristics will be vastly different, making it impossible to identify.