However, for copyright to apply, you actually have to copy something. If you coincidentally come up with the exact same song that someone else wrote already, but you never heard about the other person's song, you would not infringe copyright in the other person's song.
In contrast, patents infringement is "strict liability," meaning that you can infringe a patent without even knowing that the patent exists.