How did 'pretty' semantically shift from 'beautiful' to 'not a few, considerable'?

I suspect that an answer to your question would require a whole thesis, not a paragraph or two.

But the word "fair," which apparently is from Old English fæger, meaning "attractive, beautiful," has undergone the same process as "pretty" and is now frequently used to express "not a few," as in "a fair number," "a fair amount," "a fair few."