Why this comes up constantly
Prompts are written as multi-line text and transmitted as JSON strings. Every newline has to become \n, every quote has to be escaped, and doing it by hand in a config file is how a prompt ends up subtly corrupted.
The reverse case is just as common: you have a request log or a saved payload and you want to read the prompt that was actually sent, rather than the one you think was sent.
The debugging use
When a prompt behaves differently in production than in your editor, unescape the string from a real logged request and compare it to your source. Template interpolation, trimming and accidental double-escaping all show up immediately at that point and are nearly invisible before it.
Double-escaping is the classic one: a prompt that passes through two serialisation layers arrives at the model containing literal backslash-n sequences instead of line breaks, and the model reads them as text.
Escaping costs tokens
Each escape sequence is characters the model has to be sent. A prompt with many line breaks measurably grows when escaped, and a doubly-escaped one grows again. The counter shows the escaped size, which is the size you are billed for.