Heuristic processing, determination based on induction rather than certainty.
let's use "on the roof again" by as an example, a 90s pop punk song.
ask your brain "who made this song?"
very rapidly it goes
music people!
not all music people.
and discards bands who definitely don't sound like it: instrumental bands, classical music, slower love ballads, female singers (since the lead singer is a male in this case).
and now there's a way smaller pool to choose from, so your brain keeps going, matching broad strokes to the broad strokes you remember from the song you're thinking of, until one band sticks out as the most likely candidate, and usually at the end you can stick that determination to a specific memory you have of looking at the album cover while you listen to the song, or some concrete moment in which a line struck you and that more concrete memory helps confirm your final answer.
this is also why people can remember things "for sure" that turn out to be incorrect, because they've gone through the heuristic process and determined a most likely answer that may not be correct, because it takes much less processing power and time to heuristically determine an answer rather than specifically determining it answer, and heuristic processing does work well most of the time.