There's no instruction manual and no way to debug it. You never do anything in just one way. It wasn't designed very well by any organized process. That comes from 400 million years of evolution. The things that look simple to us are usually very complicated, and the things that look complicated are usually much simpler.
Music is a very mysterious thing.
Scientifically there don't seem to be any good theories of it. We don't know where it came from. You don't see animals tapping their feet to rhythm. Its probably one of the most intricate activities we have. It seems like its meaningful.