Pick the limit a form asks for. Each file is squeezed under it while keeping as much quality as possible.
Photos are re-saved at several quality levels to find the highest one under your limit; if even the lowest is too big, the dimensions are reduced a little and the search repeats. PDFs are re-drawn as images at lower resolution until they fit. Files already under the limit are left untouched.
No. Everything happens in your browser.
No — pages are re-drawn as images to hit the size.