What is the difference between a homographic and homophonic pun?

A homographic pun is a play on words where two words look the same but have different meanings or pronunciations, while a homophonic pun is a play on words where two words sound the same but have different meanings and spellings.

For example:
- Homographic pun: "I used to be a baker, but I couldn't make enough dough."
- Homophonic pun: "Time flies like an arrow. Fruit flies like a banana."