Soon after finishing Emma, Jane Austen's brother, Henry Austen got sick and got treated by the Prince of Wales's personal physician. Henry liked to brag about his clever sister and, despite Jane Austen's preference for anonymity, told his doctor that his sister was the author of Pride and Prejudice. The doctor passed on this information to the Prince Regent, who had a copy of all Austen's published works in each of his residences.
The end result was twofold: one, Jane Austen was invited to visit the Prince's librarian, who urged her multiple times to write a novel about himself, and two, said librarian conveyed to her His Royal Highness's permission to dedicate her next to work to him. Austen's letters show she wasn't exactly thrilled about either idea, and she asked if it was “incumbent on [her] to shew her sense of the Honour” by dedicating Emma to the Prince Regent. The librarian replied with an emphatic, but politely phrased, yes.
However, Austen got back the gallery prints and appears to have made a couple of changes to the novel to avail herself of her best and most perfect weapon: satire. This article phrases it more eloquently than the Amateur Historian ever could, but let us reflect a moment on the famous riddle in Emma:
My first displays the wealth and pomp of kings,
Lords of the earth! their luxury and ease.
Another view of man, my second brings,
Behold him there, the monarch of the seas!
But, ah! united, what reverse we have!
Man’s boasted power and freedom, all are flown;
Lord of the earth and sea, he bends a slave,
And woman, lovely woman, reigns alone.
This typical Lamb-pun thus gives us a second answer. The first two lines mean 'prince' and the second 'whales'. United, we have the Prince of Whales, who was more famous for his seductions than his statescraft, and the very subtle target of Jane Austen's amazingly clever wit. Clearly, the Prince of Whales ought to have thought twice before demanding Miss Austen dedicate a novel to him; she has skewered him more effectively than ever Captain Ahab did Moby Dick.