I wouldn't say that there's a relationship between puns and sarcasm. Certain puns may in fact be sarcastic, but that's not an essential part of it. Puns must usually be spoken aloud in order to be effective.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.