GIF is an indexed-colour format — each frame can only use a palette of up to 256 colours. This is the root cause of most GIF quality issues. Unlike video formats that use continuous 16-million-colour data, GIF must approximate each frame using the closest available palette colour.
Animated GIF stores each frame as a separate GIF image plus a timing delay. There is no inter-frame compression — every frame is stored in full. This is why GIF files grow very large with more frames or larger dimensions.