Nature's way of telling us to get something the hell out of our mouth. Something which is unpalatable tastes horrible, offends the palate. Note that unpalatable doesn't necessarily mean inedible - inedible means that humans either can't digest it or would find it poisonnous, while unpalatable merely means that it tastes bad enough that most people wouldn't even consider eating it in the first place, even if it is edible.