When you need 1 MB
A common limit for contact forms, portals and marketplaces; a high-resolution photo fits in 1 MB. The limit is usually checked against the file size in bytes, not against the picture dimensions — so a smaller file with the same look is all that matters.
How the tool hits the target
First it tries quality settings with a binary search to find the highest quality that is still ≤ 1 MB. If the minimum acceptable quality is still too heavy, it scales the image down and searches again; if there is spare room, it scales back up. Transparent PNGs are placed on a white background because JPEG has no transparency. If a file is already under the limit, it is offered unchanged.
Tips for better quality
Crop away empty background before compressing; choose WebP when the site accepts it — it is usually noticeably smaller than JPEG at similar quality; and avoid compressing an already compressed file many times in a row.