What is GIF?
Thirty-five years old and still everywhere, because it does one thing nothing else quite does: animate inline, silently, in any context that displays an image. The cost is a 256-colour palette and no real motion compression, which makes GIF a poor way to store video and an excellent way to send a three-second loop.
What is JPG?
JPEG is where photographs live. Its compression is lossy - it throws away detail the eye is bad at noticing, and throws away a bit more every time you re-save - which buys huge size savings on photos and makes a mess of screenshots and text. There's no transparency in it at all.