Modern science has no idea! I've researched a fair bit. We don't know how the brain intreprets frequency combinations or why different ones sound good or bad together or evoke certain moods. Math can explain harmonics and the circle of fifths and how to assemble keys and modes, sure, but no one knows the Why or How of the internals between the ears. It is just cultural bias and repetition that we intrepret some note and chord combinations a certain way or is there something more fundamental going on with the hardware? Good question! Nobody knows.
All we have is anecdotal evidence and the trial and error of the musicians and composers who make it. Music is still a mystery.