The converter loads a browser version of FFmpeg only when you start an export. It samples the selected video frames, resizes them with Lanczos scaling, builds a clip-specific color palette, and applies that palette to the final looping GIF.
GIF stores full image frames and supports at most 256 palette colors, so it is usually much larger than an MP4 of the same clip. A short duration, moderate width, and lower frame rate give the biggest size reduction.