Why animated GIFs get so large
A GIF stores each frame as its own palette-indexed bitmap, with no motion compression of the kind video codecs use. There is no concept of describing how pixels moved between frames, so a two-second clip at 25 frames per second is closer to fifty stacked images than to a video. That is why a short GIF can easily outweigh a high-resolution photograph.
Two limits define the format. Each frame can reference at most 256 colours, and compression is LZW over the palette indices, which rewards flat areas and repeated patterns while punishing noise and gradients. Understanding both explains every compression decision below: reducing the palette makes the index stream cheaper, and reducing dithering keeps that stream repetitive enough for LZW to work with.