What is the difference between a homophonic pun and a homographic pun?

A homophonic pun is a wordplay that relies on words that sound the same but have different meanings. In this type of pun, the humor comes from the similarity in pronunciation rather than the appearance of the words. For example: "Why was the math book sad? Because it had too many problems (prose, refereeing to difficulties)!"

On the other hand, a homographic pun uses words that are spelled the same but have different meanings. It plays with the multiple meanings or interpretations of a word based on its context. These puns often rely on the ambiguity of the word's spelling. For example: "I used to be a baker, but I couldn't make enough dough (refereeing to money)!"

In summary, the difference lies in whether the pun is based on similar-sounding words (homophonic pun) or on words with the same spelling but different meanings (homographic pun).