How does a word once full of negative connotations come to mean something positive? Take nice, for example. Nice is a word that English schoolchildren are often taught to avoid in their writing. They are told that it's too bland, too general and that they should come up with much better descriptive adjectives. H.W. Fowler in his Modern English Usage (1926) complained that the word had been 'too great a favourite with the ladies, who have charmed out of it all its individuality & converted it into a mere diffuser of vague & mild agreeableness.' Whether 'the ladies' can justifiably be blamed or not, nice has had a long and complicated history and it's not always easy to disentangle the various meanings that it has carried at one time or another.
Its ultimate root is the Latin nescius (ignorant, unknowing). The -sci- element, from scire (to know), survives in words like conscious and science. Nice was common in the 14th and 15th centuries with the meaning 'foolish or stupid'. During the same period, it also meant 'indecent or immoral', 'effeminate', 'strange' and 'lazy'. Quite a list of negatives for a word now seen as positive. Other meanings that nice took on listed by the OED include 'extravagant', 'over-refined', 'shy', 'fussy', 'cultured', 'precise', 'subtle', 'trivial' and 'appetizing', as well as its current meaning of 'agreeable or pleasant'. Apart from the meaning of 'agreeable', the meaning of 'precise' still survives in the derivative niceties (precise details).
We're guessing, of course, when we try to recreate the precise evolution of a word, since writers are not always generous enough to provide us with a context from which we can infer that they meant this particular meaning and not this one. However, it seems that in general terms stupidity was linked to immorality, which in turn was linked to excess or extravagance, which was linked to luxury, which was linked to refinement, which was linked to discernment, which was linked to precision, and also to pleasantness. Perhaps it all helps to explain why describing someone as nice often feels like a rather back-handed compliment.