Imagine sitting in a restaurant when that one song that your friend showed you two weeks ago starts playing. And you just cannot remember the name of the song. So, you pull out your phone and (if you have an iPhone) click the Shazam button in your control center. After about 5 seconds the title of the song and it's artist pops up on your phone screen. Now you can add the song to a playlist and listen.
...but how did your phone know what song it was? Did it listen to the song and go compare it to a database of who knows how many songs? Did it record the lyrics and search for the same lyrics to figure it out? And what about the background noise? If other people were talking and it was recording words, how did it know to filter out those words?