Perception of consonance of a sound can be approximated by decomposing it into sine waves and calculating the sum of the values on the Plomp and Levelt curve (which is empirically measured and a consequence of human biology) for the intervals of all pairs of sine waves, weighted by amplitude. For instruments based around the harmonic series this results in standard Western harmony. There is nothing mystical about it, and the human brain does not have any ratio detector hardware. It's purely an artefact of a simpler underlying rule.
Other instruments, eg. tuned percussion, do not have this constraint. If you clamp a bar at one end and strike it you can get all kinds of inharmonic overtones. This means cultures with music based around these types of instruments (eg. Indonesian classical music) need completely different harmonic theory.
See http://sethares.engr.wisc.edu/paperspdf/consonance.pdf
This generalizes all existing theories of musical harmony, and explains things like stretched tuning in pianos (a consequence of non-ideal strings).