Why one emoji needs two \u escapes, and what the halves mean
Unicode gives every character a number called its code point. The letter A is U+0041, é is U+00E9, 日 is U+65E5 and 😀 is U+1F600, where the digits after U+ are hexadecimal. A Unicode escape is a way to write a character by its number instead of by its shape, using only plain ASCII. In JavaScript, JSON, Java, C# and many other languages, \u00e9 inside a string means é. That is useful whenever a file has to stay ASCII, when a character is invisible or easy to confuse, such as a non-breaking space (\u00a0) or a zero-width joiner (\u200d), or when you want to see exactly which character a string holds.
Encode "café" here and you get caf\u00e9: plain letters stay as they are and only the é is escaped. The four hex digits after \u are the code point itself, padded with zeros. Four hex digits can reach FFFF, which is 65,535, and when these escapes were designed that was meant to be every character there would ever be. It was not. Unicode now runs to 10FFFF, and everything past FFFF, including emoji, many historic scripts and rarer Chinese characters, does not fit in four digits.
Languages that had already committed to 16-bit characters solved this with surrogate pairs. A code point beyond FFFF is split into two 16-bit halves taken from a range reserved for nothing else. For 😀, subtract 10000 from 1F600 to get F600, which is twenty bits. The top ten bits, 3D, are added to D800 to give the high half D83D; the bottom ten bits, 200, are added to DC00 to give the low half DE00. So 😀 is written \ud83d\ude00. Neither half is a character by itself, which is why "\ud83d" on its own is reported here as an error: it is half of something whose other half is missing. It is also why "😀".length is 2 in JavaScript.
Since 2015, JavaScript has had a second form, \u{1f600}, with braces around up to six hex digits. It writes the code point directly, with no arithmetic, and Rust and Swift use the same idea. The catch is that JSON never adopted it: a JSON parser will reject \u{1f600}. That is why the encoder offers both styles. The brace style is easier to read and is the default; the pair style is what you need for JSON, Java and C#. The decoder reads either, and combines a correct pair into the single character it stands for.
The decoder also reads the other escapes that turn up in the same strings: \n for a new line, \t for a tab, \" and \' for quotes, \\ for a backslash and \x41 for a character from 0 to FF. That covers most strings copied out of JSON, logs and source code. An escape it does not know, such as the \p in C:\path, is left exactly as written, because a backslash in pasted text is more often part of a Windows path than a mistake. Malformed escapes, such as \u with fewer than four hex digits or a number past 10FFFF, are reported with their position so you can find them.