Smaller size
Whitespace in a readable format does not matter on the wire. Minified JSON is shorter and easier to copy. Deeper indent and nesting usually save more characters.
Logs, message queues, and some gateways prefer single-line JSON so one record is not split across lines.
Semantics stay the same
Only meaningless whitespace is removed. Numbers, strings, and field names are unchanged. After minify, JSON.parse should produce the same object.
Spaces and escaped newlines inside strings are kept, so copy is not trimmed.
Validate before minifying
Invalid input shows an error so bad data is not packed into a script. Trailing commas and single quotes are caught before minify.
Loose JS config should go through the JSON5 page to become standard JSON first.