Compression here means re-encoding. Your image is decoded into pixels, drawn on a canvas (in a background Web Worker when your browser supports it), and saved again in the format you pick at the quality you pick. A lower quality setting tells the encoder to throw away more fine detail, which is what makes the file smaller.
It handles one image at a time so you can judge the result in the comparison slider before saving. For a folder of images with the same settings, use the Bulk Image Compressor. If you need to land under a specific size, such as an upload form that rejects files above 100 KB, the Reduce Image Size tool lets you type a target instead of guessing a quality.