Photos taken on a phone or exported from editing software are usually encoded conservatively, leaving quality on the table that nobody can actually see on a screen. Compression re-encodes the pixel data at a quality setting tuned for that gap — small enough to matter, high enough that a side-by-side comparison at normal viewing size looks identical.
The three levels here map to how much of that headroom to use: Light barely touches it, Balanced takes the difference nobody notices, Extreme takes it as far as it goes before softness becomes visible.
Everything runs in your browser. Your file is never uploaded, never queued on a server, and never deleted from one — because it was never there.