Why in the browser
The usual way to compress an image online is to upload it to a server, let the server do the work, and download the result. That works, but it means handing your file to a company whose retention policy you have not read, for a job your own device can do in about a second.
Everything on this bench uses the canvas API that has been in browsers for over a decade. Your file is read from disk into the page, worked on, and written back out. It is never sent anywhere, and that is verifiable rather than promised — the network tab in your browser's developer tools will show you an empty list while the tool runs.