A pun is a play on words. If a bird flying overhead takes a poop on the cake you’re carrying, you could say “Isn’t that just the icing on the cake!” But only if you want to be punny.
Friend of the double entendre and other witticisms, a pun is a comedic phrase that plays off of the sounds and double meanings of words. Puns can be quite clever, but often come off as silly, cheeseball attempts at humor. That's probably why any good comedian will tell you that "a pun is a short quip followed by a long groan."