The tool first draws your image at full size (anything longer than 4096 pixels on its long side is reduced to 4096 px) and encodes it at quality 0.8. If that file is already at or under the target (and not larger than your original), you get it straight away. If not, it repeats up to 10 times. On each pass it multiplies the quality by 0.95 (0.85 for PNG) and, because the first attempt was too big, also shrinks the width and height to 95% of the previous pass.
Ten passes is the limit. After all ten, the width and height have dropped to about 60% of where they started and the quality setting to about 0.48. If the file is still too big at that point, you get the last attempt and a note saying the target was not reached.
KB here means 1024 bytes, which is how most operating systems and upload forms measure it. If a form says "100 KB" and you want a margin for error, enter 95.