Well, I don't know if you need a practical or technical answer.
Almost the best music database is MusicBrainz.
They developed fingerprint technology that calculates what they call PUID.
The database is huge (its largest there), and there are tools. And it's free.
Picard Tagger is a cross-platform tool for what you are trying to do.
Technically, there are many different approaches. Especially in the audio segment there are really many methods. Most rely on frequency spectrum analysis. But also consider the rhythm and development of certain characteristics over time and, of course, trivial parameters such as length, etc.
Finding a sound fingerprint should give you a lot of results.