I mean how exactly they work isn't public knowledge. But we can be sure they don't just hash anything. It would be too easy to just add small amounts of noise and defeat them.
Here's a reference I googled for you https://www.toptal.com/algorithms/shazam-it-music-processing...