Music copyright infringement is when a “Song B” copies, without license, protectable expression from an earlier “Song A”, enough and in a way that society should find it a trespass, a tort, a wrongdoing.
That’s infringement between two songs. Using a song or recording itself without license, by copying, performing or distributing it, is infringement too.
Infringement requires copying
Infringement requires copying, and copying requires access. To infringe, you must copy “Song A”, and to copy “Song A”, you need to have first heard “Song A”. Sounding the same in the absence of copying and access would be a coincidence. And coincidence is not an infringement.
Copying doesn’t need to be intentional, or conscious, but it does require having had access to the prior work. You can’t copy something you’ve never been exposed to at all. Accidental or subconscious copying would still be copying, but coincidental likenesses would not be. (How to not get sued for copyright infringement.)
No amount of access makes dissimilar music more similar. (Some thoughts on Arnstein.)
Infringement requires substantial similarity
In addition to copying, infringement requires substantial similarity of elements that are original to and protectable by the plaintiff. That is somewhat a matter of degree, specificity, and originality, all of which quite logically oppose the likelihood of chance. So a big part of the work as a forensic musicologist is evaluating originality in musical works, because it informs both of the key questions: “Was it copied?” And if so, “did that copying amount to unlawful appropriation?” (Why Mariah Carey didn’t steal “All I Want For Christmas Is You”.)
What infringement isn’t
Whereas plagiarism is perhaps a moral wrong, copyright infringement is a legal one. (Plagiarism and copyright infringement: what’s the difference?)
Interpolation, sampling, and substantial similarity: any of them might amount to infringement, but they have specific meanings, and when they are used incorrectly or interchangeably, it’s confusing and obfuscating. (Interpolation, sampling, or similarity?)