Decode-then-re-encode per image
Each source file is loaded into the browser and drawn onto an off-screen canvas, then exported through the canvas's blob-encoding step with the target format and quality you set. This is why the tool can convert between any of PNG, JPG, WebP, and AVIF in either direction - it isn't rewriting file headers, it's fully decoding pixels and re-encoding them.