In the History Channel documentary How the Earth Made Man, they list how various aspects and attributes in human biology and behavior can be explained as remnants of the evolution of humans and the Earth.
One of the qualities they explained was the reason that humans find the sound of nails scraping on a chalkboard to be so grating and causing us to cringe. Unfortunately they got it completely wrong.
Their explanation is that our primate ancestors who lived in trees and avoided predators would use a screeching sound to warn of danger, and so we now find that sound to be disturbing. It sounds like a good explanation but it is specious.
It is true that humans find the sound of nails grating on a chalkboard to be unnerving, but it is not the sound itself that is disturbing, it is the knowledge of what it feels like. To wit, scraping a lenticular with our nails produces a completely different noise, but the same cringe-inducing shudder. It is the physical sensation that repulses us so much.
Next time your hands are slick with oil or soap, scrape your fingernails along the ridges of the fingerprints on your thumb. There is pretty much no noise at all, yet the feeling is just awful. Clearly it is the sensation, that is, the vibration that is so aversive.
Something about the tactile feel of quick, small, sharp, repetitive vibrations is extremely uncomfortable and undesirable to humans, and certain sounds like nails on a chalkboard remind us of that.