When you need 500 KB
Usually enough for a full-width photo on a website or for uploading scans to forms limited to 0.5 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 ≤ 500 KB. 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.