The story
The “pretty” here has nothing to do with looks. It’s an old sense meaning “considerable,” and “penny” just stands for money. In a comedy by Susanna Centlivre, written around 1709, a character hopes for “a pretty Penny,” and she wrote “a fine Penny” in her next play. Thackeray was still using it in the 1840s.